Coder Social home page Coder Social logo

aureliojargas / aurelio.net Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 6.0 126.55 MB

Sources for Aurelio.net website

HTML 83.19% Ruby 0.04% CSS 0.80% JavaScript 0.27% Python 11.17% Shell 1.11% Java 0.29% PHP 0.51% Emacs Lisp 0.04% sed 1.53% Makefile 0.01% Vim Script 1.03% Dockerfile 0.01%

aurelio.net's People

Contributors

aureliojargas avatar meleu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aurelio.net's Issues

New site check: pages not using templates

Grep for full <html> files that are not using any site template.

Those are usually old stand alone pages, with old code, old bugs.

Try to modernize whatever you can.

Create /foo → /foo/ redirects for all folders

As explained in #20, Netlify serve two URLs for each folder: with and without the trailing slash.

The relative path problem I'll fix in that issue, but it's still annoying two have this behavior (and might be bad for SEO).

I've contacted Netlify support for a solution, but for now I can make a workaround hardcoding 301 redirects for all folders of my site in the _redirects file.

Simplify sed-HOWTO

There are three versions of this document:

  • /sed/sed-HOWTO/ -- HTML, multi-page
  • /sed/sed-HOWTO.html -- HTML, single page
  • /sed/sed-HOWTO.txt -- Text

I want to have just one version, and I think the single page HTML is the best. Simpler, no navigation, easier to Ctrl-F.

But the official URL is the multi page one.

So I'll move the single page document to the official URL and kill everything else. The remaining will be:

  • /sed/sed-HOWTO/ -- HTML, single page

Create theme demo page

I always forget what are the components available in the site theme. Create a single page with a demo. It will serve as a reference to the correct HTML markup.

Switch to https only (mixed content)

  • Configure Netlify to force https (it was enforced sometime in 2018)
  • Update all site links to point to https
  • Update all resources (images, css, js, favicon, ...) to use https or root-relative paths
  • Check if all my JavaScripts continue working
  • External resources (JavaScripts) must be updated too
  • Assets should be in a separate http domain for speed? NO, KISS

How to show mixed content problems so I can fix them?

  • Netlify deploy warns about Insecure mixed content detected when there are HTTP resources linked in the git commit files (example)

Learn more about mixed content: https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content

To find the offending lines:

$ git grep -F 'src="http://aurelio.net' | wc -l  # html
386
$ git grep -E '!\[[^]]*\]\(http://aurelio.net/' | wc -l  # markdown images
183
$ git grep -F 'http://aurelio.net/' | wc -l  # generic catchall
3599

Fix old WordPress image URLs with parameters

Some posts are still using old WordPress URLs for images, such as:

  • /wp/wp-content/uploads/2008/04/1o-cultura-shot.jpg?w=350

The parameter is ignored, since now I only have the original images. Check each post using this, fix the URL and maybe resize the image if needed.

I have a copy of the WordPress resized images in my private /a/www/admin/wp folder.

Create site check script

Some post-conversion checks to make sure that everything is ok.

Some examples of bad practices to report:

  • Relative URLs in images and hrefs
  • Malformed HTML (ie. missing quotes in attributes)
  • Non UTF-8 file
  • Odd path for images
  • CSS inline

Create index pages for naked directories

Some folders of my site do not have a index.html file. I used to just let Apache list the files.

Now on Netlify, this does not work anymore. I have to create the index files.

Decide CSS file standard placement and name

  • ./assets/2013/ads.css
  • ./assets/2013/site.css
  • ./assets/2013/topbar.css
  • ./assets/2014.css
  • ./assets/articles.css
  • ./assets/bars.css
  • ./assets/bars2.css
  • ./assets/common.css
  • ./assets/gh-fork-ribbon.css
  • ./assets/jekyll.css
  • ./assets/monokai.css
  • ./assets/reset.css
  • ./assets/vim.css
  • ./baterna/baterna.css
  • ./coisinha/inc/coisinha.css
  • ./coisinha/inc/index.css
  • ./coisinha/inc/nav.css
  • ./coisinha/inc/nav2.css
  • ./coisinha/inc/nav3.css
  • ./coisinha/inc/print.css
  • ./coisinha/inc/yui-2.7.0.css
  • ./curso/prompt-doc.css
  • ./dumbs/dumbs.css
  • ./projects/emomemory/emomemory.css
  • ./projects/sedsed/index.css
  • ./projects/soft4.css
  • ./projects/txt2regex/index.css
  • ./rac/info/exemplo.css
  • ./rac/info/tutorial/tutorial.css
  • ./rac/site.css
  • ./regex/guia/styles.css
  • ./regex/regex.css
  • ./surf/site-sub.css
  • ./surf/site.css
  • ./viagem/atacama/mapas/mapas.css
  • ./viagem/viagem.css

It seems CSS files related to layouts are in /assets.

But there's that extra vim.css, that pertains to the /vim area.

It seems areas have their CSS file inside their folder , but the naming is not consistent.

Decide what would be the desired pattern, document it in the main README and fix the outliers.

Make /projects layout mobile-friendly

Must use the head-base.html include.

But rethink this section. Maybe that info should be in GitHub README.md only. Maybe ditch the sidebar. Maybe convert to a one-page. I don't know.

Simplify blog posts URLs

In the past I've used WordPress for the blog. That era is gone, but the ugly URLs remain:

It's pointless to have the full date in the URL since the publish date is already in the post and it is very unlikely that I'll repeat post titles (so the date would be a differential).

Maybe leave only the year, maybe not.

  • Take a decision
  • Configure Jekyll accordingly
  • Set up URL redirect rules
  • Update all links to blog posts

Kill "massa" theme

Used by just a single page:

$ git grep -l include/massa/config.t2t
musica/index.t2t
$

Migrate to the default theme.

Kill "10anos" theme

Migrate those pages to the default layout.

$ git grep -l include/10anos/config.t2t
doc/coluna/index.t2t
mac/dev/index.t2t
mac/index.t2t
moneylog/_config.t2t
moneylog/faq/index.t2t
moneylog/v4/index.t2t
sed/alfabeto.t2t
sed/index.t2t
sed/livro/index.t2t
sed/sed-HOWTO/config.t2t
shell/canivete/canivete.conf
shell/dialog/index-v6.t2t
shell/dialog/index.t2t
shell/miniman/index.t2t
vim/index.t2t
vim/ooo-vi.t2t
vim/pulando.t2t
vim/selecao-vi-sual.t2t
vim/vi-vim-venci.t2t
vim/vim-comandos.t2t
vim/vim-dicas-ivan.t2t
$

Can I use GitHub Pages?

Currently I host my website in a DreamHost shared server. I use rsync to update it from my desktop.

If I could switch to GitHub Pages (or GitLab Pages, which is more flexible), hosting and deploy (see issue #12) would be solved problems. I guess their servers are also faster than my current one.

What stops me from doing that now:

Fix broken Google Code URLs

Since 2016 Google Code stopped operations and archived all the projects.

I am hosting there all the ZIP files for my AppleScripts.

The files are still available, but now under a new URL.

Update all the links to the new URLs.

Or maybe just host them in my website, they're only a few megabytes total.

See also: #48

text-tool: Ideas for new tools

  • Add a prefix to all lines
  • Add a suffix to all lines
  • Number lines
  • grep -i, -F, and maybe -v
  • replace using regex
  • replace last occurence
  • sort -n

Remove txt2tags plugin dependency

I am trying to make my site simpler. That means not having to carry a txt2tags plugin to convert files.

Now there are two kinds of txt2tags files in my site:

  • Old legacy .t2t files that were added together with their relative .html file, with no front matter (they are not processed by Jekyll)
  • Pages that I have added to Jekyll as .t2t files and are converted by the txt2tags_converter.rb plugin when doing jekyll build.

The first legacy files I'll handle in the future.

For now I'm interested in removing the txt2tags from Jekyll build, so I can ditch the plugin. You must convert these files to Markdown or to plain HTML:

  • /_includes/urls.t2t
  • /articles/_config.t2t
  • /articles/applescript-install.t2t
  • /articles/applescript-vs-python.t2t
  • /articles/dropbox-ignore-folder.t2t
  • /articles/dropbox-iphoto-11.t2t
  • /articles/dropbox-iphoto-import.t2t
  • /articles/dropbox-selective-sync.t2t
  • /articles/dropbox-symlinks.t2t
  • /articles/hungry-sumo-high-scores.t2t
  • /articles/iphoto-symlinks.t2t
  • /articles/sed-abc.t2t
  • /articles/shell-reference.t2t
  • /blog-arquivo.t2t
  • /cygwin/index.t2t
  • /cygwin/rdl/artigo-rdl.t2t
  • /cygwin/rdl/artigo-v0.t2t
  • /cygwin/rdl/bug.t2t
  • /cygwin/rdl/index.t2t

Plain HTML is preferred since Markdown is another dependency that adds complexity to the site.

Create build script

Now that I'm using Netlify, it would be nice to isolate the build command into a script.

Also, I can make some post-conversion checks in this script to make sure that everything is ok, and abort the deploy otherwise. See #29

Move /wp to /img

This is an old mess. Move it under /img and fix the references.

URLs that point to folders should have the trailing slash

In practice it works without the trailing slash, but it depends on the web server and tools support. As seen on #20, this isn't always the case.

Also, when searching/replacing URLs in the site sources, having this "with or without" exception makes things more complicated.

Let's just stick to the rule of always having a slash.

Create a check for it and fix all the outliers.

Fix non UTF-8 files

There are still some legacy files encoded in ISO-8859-1. You must convert them to UTF-8.

Kill "kiwi" theme

Used by just a few old txt2tags pages. Migrate those pages to the default layout.

$ git grep -l include/kiwi/config.t2t
doc/changelog-nerd.t2t
doc/direto/homologacao.t2t
doc/direto/index.t2t
doc/dort.t2t
doc/faq.t2t
doc/guerra-editores.t2t
doc/index.t2t
doc/irc-mar2005.t2t
doc/nerd.t2t
doc/sem-mouse-HOWTO.t2t
doc/videogame.t2t
mim.t2t
sed/sed-HOWTO/config.t2t
shell/apostila/comprar.t2t
shell/apostila/conteudo.t2t
shell/apostila/historia.t2t
shell/apostila/index.t2t
shell/apostila/leitores.t2t
shell/apostila/papel.t2t
$

Use figure tag for images with caption

Currently, my caption plugin generates this markup:

<p class="figure">
  <img src="image.jpg" alt="image caption">
  <span>image caption</span>
</p>

but the html5 version should be:

<figure>
  <img src="image.jpg" alt="image caption">
  <figcaption>image caption</figcaption>
</figure>

Migrate baterna comments

The course comments (550+) should be on https://aurelio.net/baterna/, but unfortunately they are on http://aurelio.net/blog/2006/10/20/baterna-curso-de-bateria-online-e-gratuito/.

Disqus has a migration tool via CSV which I can upload the URL mapping. See https://help.disqus.com/customer/en/portal/articles/912757-url-mapper

  • Turn on comments on /baterna
  • In /baterna contents, remove the links to the blog post
  • Migrate the URLs in Disqus CSV
  • Wait for the migration to complete
  • Close the comments on the blog post
  • Rework the blog post text since now there are no comments there
  • Rework the course text to acknowledge that now the comments are here

Relative URLs may break (use root-relative)

In Apache and GitHub Pages, a slashless folder URL is always 301 redirected to have a trailing slash:

  • /shell → /shell/

In Netlify, both URLs are served. This breaks relative URLs for links and images, since now the "current" folder could be / or /shell, depending on the trailing slash presence.

One solution is to always use absolute URLs, for everything. I cannot browse the site locally (offline), but will have a consistent absolute-only references. The absolute URL can use the full domain or be just the path (called root-relative). Too many options to decide :(

Update: That was a Netlify bug, see #34 (comment). Now the folder redirects are working ok. But regardless, I'll leave this issue open because fixing those paths is a good idea.

Fix folder redirects

In old Apache, using /foo /bar is enough to redirect all requests to /foo and its subfolders and files to /bar, for example, /foo/abc.html becomes /bar/abc.html.

But in Netlify, this same redirect is applied only for the /foo folder itself, not its children. You have to explicitly say /foo/* /bar/:splat to get the same behavior as Apache.

I migrated the redirect rules from Apache to Netlify without taking that into account. So I need to review all the folder redirects and fix where needed.

Do not use old redirected URLs

Grep for every URL in the _redirects file to check if I'm not still using the old URL in some pages.

Add this check to _scripts/check-site.

sed-HOWTO not appearing the two versions

I have two versions of the same document:

But now on Netlify only the "all in one" is being served on both URLs :(

In other words, when accessing http://aurelio.net/sed/sed-HOWTO/, the contents of http://aurelio.net/sed/sed-HOWTO.html is being shown. This is the contents that should be appearing: only the TOC links, not the full HOWTO document.

I do not have turned on the “Pretty URLs” post processing, so this should not happen.

KISS

Keep the site simple to manage, build, publish and migrate to other tools/servers.

  • Minimize the number of tools, formats, technologies and knowledge required
  • Minimize dependency on tool features (Jekyll, txt2tags, Markdown, plugins)
  • Minimize conversions and processing (try to use plain HTML)
  • Minimize the number of different layouts
  • Keep the layout and partials structure simple
  • Keep the URLs simple and obvious (files and folders, no custom permalinks)
  • A global search/replace is simpler than a complex automatic DRY beast
  • No magic, no algorithms, no programming

Remember a folder with some .html files inside? That was simple.

Convert txt2tags files to Markdown or HTML

My goal is to make the site simpler. See issue #1.

Currently, there are four kinds of content files in my website:

$ find . -name '*.t2t'  | wc -l
274
$ find . -name '*.md'   | wc -l                                                                   
138
$ find . -name '*.html' | wc -l                                                                 
1401
$ find . -name '*.txt'  | wc -l                                                                  
114
$

I would be happier if I could use just HTML and txt, and never have to convert anything. But life's hard, and I need a tool like Jekyll to automate things.

For now, I'm trying to reduce complexity.

The ideia is to remove the need to have txt2tags (my own tool) to convert files to HTML. It's kinda sad making this move, but Markdown is well supported everywhere an has excellent tooling. I can even try the GitHub Pages or GitLab Pages hosting in the future and save hosting costs. I also don't want to keep maintaining txt2tags forever, so it gotta go :(

  • Some very very old txt2ags files I will never update, they are legacy. Those could be converted to HTML and be done.

  • Other txt2tags files are areas of the site I still have interest in updating, so maybe Markdown would be best.

I still don't know if I will get 100% done, but I'll try.

Those are the site areas with txt2tags files:

  • baterna
  • c0d4r3
  • correria
  • curso
  • doc
  • email
  • fvm
  • include
  • mac
  • misc
  • moneylog
  • musica
  • projects
  • rac
  • sed
  • shell
  • viagem
  • vim

To see the updated area list, run:

find . -name '*.t2t' | grep -v '^\./_site/' | cut -d/ -f2 | sort | uniq

Remove duplicate database.t2t files

  • include/urls.t2t
  • include/kiwi/database.t2t
  • include/10anos/database.t2t

Those are all the same files. They used to be symlinks pointing to the same file, but were flattened when added to Git.

They will all die when those themes are gone. Maybe just hang on a little longer.

YouTube videos: Liquid tag or HTML?

Decide one single way of embbeding YouTube videos into pages.

I use a plugin that adds a Liquid tag for YouTube videos. But currently there is only one page using that tag:

$ git grep '% youtube'                                                                                 
_plugins/youtube.rb:# {% youtube oHg5SJYRHA0 %}
_plugins/youtube.rb:# {% youtube oHg5SJYRHA0 500 400 %}
viagem/farol-de-santa-marta/index.md:{% youtube npyF7avT-9s %}
$

All the other videos are added by hand using the HTML snippet YouTube provides.

$ git grep youtube.com | wc -l
110

There are different version of the snippet, some using iframe, some using object.

Remember that half the site is processed by Jekyll, the other half are legacy pages. Maybe a single different solution for each is a good first step.

Source tree must be identical to site tree

  • Currently in some cases, the foo.md file generate foo/index.html.
  • Make the sources be foo/index.md as well.

This reduces complexity since we have the same tree, regardless. No need to think, no need to check config. Also, it will be easier to switch from Jekyll in the future.

The blog posts will be the only exception since Jekyll requires the DATE-post.md format and I do not want to change the long time adopted YEAR/MONTH/DAY/POST URL for posts.

CSS: Add print styles

For the main theme, add print directives to remove the crap (sidebar, footer, etc), colors on <PRE> and decrease the vertical spacing to avoid spanning multiple pages.

Create repo for the AppleScripts

My old AppleScripts now under /projects (previously /soft) were only available as ZIP files which contained the compiled .scpt files. Those ZIP files were once hosted at my site, then I moved them to Google Code.

There are two problems now:

  1. There is no viewable web version of the code.
  2. Google Code is no more and all the links are broken, so nobody can download the scripts. Fixed in #51

To solve both, create a new repo in GitHub to hold the AppleScripts in their text version, and also put the ZIP files as binary releases inside that repo (or just move them back to my website).

  • Create a commit for each released version.
  • Edit the commit date to match the release date.
  • Use the changelog as the commit message.
  • Maybe also link to the original announcement blog post.

Refer https://aureliosoft.wordpress.com for the release dates, changelog and announcements.

Add layout for /coisinha

Currently, the common parts are all hardcoded in each file.

Maybe not a full layout, since each page is different in layout, CSS and JavaScript, but at least isolate common snippets as includes.

Remove obsoleted CSS class references

For example, old WordPress classes that are not used by the current theme:

<img class="alignright size-thumbnail wp-image-267" title="Pote de Moedas" src="/wp/wp-content/uploads/2007/09/moedas.jpg?w=128" alt="" width="128" height="96" />

Kill "clean" theme

Used by just a few pages. Migrate to the default theme.

$ git grep -l include/clean/config.t2t
baterna/index.t2t
fvm/config.t2t
fvm/index.t2t
include/clean/config.t2t
mac/dev/tutorial-pyobjc/index.t2t
musica/index.t2t
musica/perolas-punk.t2t
musica/shows.t2t
viagem/atacama/album/config.t2t
viagem/atacama/config.t2t
viagem/config.t2t
$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.