1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-15 08:47:03 +01:00
Commit Graph

21 Commits

Author SHA1 Message Date
f7d9451aa6
layouts: Fix minor encoding issue with dates
This is similar to other encoding issues we have fixed lately where
we need to make sure Hugo (or Golang's HTML template library) does
not escape our non-ASCII content.

For example, this is how our datetimes end up currently:

    <p class="blog-post-meta"><time datetime="2020-01-16T09:23:20&#43;02:00">Thu Jan 16, 2020</time> by Alan Orth

After printing them with `printf` and filtering them with the Hugo
built-in function `safeHTMLAttr` they look like this:

    <p class="blog-post-meta"><time datetime="2020-01-16T09:23:20+02:00">Thu Jan 16, 2020</time> by Alan Orth

See: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html
See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/111
2020-03-22 11:09:27 +02:00
b862745a0d
Localize "by" and "in" strings in post meta
This became a problem when I added right-to-left language support.
When you mix RTL languages like Arabic with English (even for just
dates and small strings) everything becomes jumbled. For now I have
only added translations for English (default), Arabic, and Bulgarian.
2019-04-22 18:51:33 +03:00
DeedleFake
663f3db2a0 Add Vim Modeline Comments to Files (#18)
* Add Vim modeline comments to all relevent template files.

* Add Vim modeline comments to a few other files.

* Move modeline comments inside the template definitions in list and single.

For some odd reason, putting them outside breaks the page generation.

* Use template comments for modeline comments in templates.

* Fix form 2 modelines.
2016-11-24 14:33:56 +02:00
abfc8ad15c
Make "→" in "Read more" part of the i18n strings
Eventually I'd like to support right-to-left languages like Arabic
and we'd need the arrow to point the other way for that.
2016-11-20 12:14:46 +02:00
cdcae6c8a4
layouts: Don't assume date_format is defined
User can override the date format with date_format, but we should
have a default in the case that the user hasn't defined it.
2016-10-17 23:39:41 -04:00
d6328c34df
Remove anchor titles
I had only added these for accessibility, but after some research
it seems that assistive technologies don't use these.
2016-10-06 14:21:30 +03:00
3a6bed5be7
layouts: Use Markdown filter on titles
This makes it possible to have Black Friday config options like
quote style also affect post titles.
2016-10-06 14:17:59 +03:00
577e168da5
Use i18n to translate some strings
Hugo 0.17 allows for easy multi-lingual sites. Strings can be
translated either in the theme or in the site, and missing strings
will fall back to the default language.

See: https://github.com/spf13/hugo/blob/master/docs/content/content/multilingual.md
2016-10-03 22:58:22 +03:00
48a6a82dcc
layouts/_default/summary.html: Remove extraneous spaces 2016-09-27 23:22:46 +03:00
d16fe216a5
layouts: Remove link from author name in summary/posts
There is no author archive yet, so this link doesn't go anywhere!
2016-09-27 23:21:01 +03:00
884713fc2a
layouts: Add theme support for categories and tags
Add categories/tags to front matter and they will be displayed on
summary and post pages, with links to taxonomy pages. Example:

  +++
  date = "2016-09-24T21:28:31+03:00"
  title = "Post title"
  categories = ["Nature"]
  tags = ["Wetland", "Oasis"]
  +++

For some reason if you add tags singularly, like:

  categories = "Nature"

you get index errors from Hugo. Not sure if I need to parse the
tags differently or just add more logic to test if the terms are
singular or not.
2016-09-26 08:32:46 +03:00
cd3e327553
layouts: Use HTML5-compatible datetime format for posts
The W3C validator was complaining.

See: https://validator.w3.org
See: https://html.spec.whatwg.org/multipage/semantics.html#the-time-element
2016-09-14 13:12:27 +03:00
8c4b423173
layouts/_default/summary.html: Fix W3C validation error
The validator[0] says:

  Element nobr not allowed as child of element a in this context.

... so I'll just remove it.

[0] https://validator.w3.org
2016-09-14 12:39:40 +03:00
d37e111ff4
Adjust header levels for post summary and page
The W3C's HTML5 documentation says that header strength (h1–h6) is
only important per section, but their validator[0] recommends only
using one h1.

[0] https://validator.w3.org/
2016-09-14 12:28:15 +03:00
1f0799b9f1
Use H1 headers in <article> sections
Headers are a semantic element that help computers understand the
content. In general, header tags should follow rank order, but the
most important is that the first header inside a section will serve
as the title in a table of contents, etc, but since article sections
stand alone as independent documents, I like the idea of explicitly
starting with H1 tags.

See: http://diveinto.html5doctor.com/semantics.html
2016-09-02 10:12:36 +03:00
54ba5518d2
Use HTML5 <header> tags in articles
The HTML5 <article> tag represents a complete, or self-contained,
composition in a document. Headers are a semantic HTML5 element
that helps computers understand the content.
2016-09-02 10:09:17 +03:00
412cc18cf9
Start using Go 1.6's blocks
Partials are nice, but blocks are a better base construct. Right
now there is basically only layouts/_default/baseof.html that is
doing most of the work.

See: https://gohugo.io/templates/blocks
2016-09-01 17:37:27 +03:00
4c68cf71b0
Move summary layout to posts
The only content type we have is posts, so the summary type should
be there.
2016-08-30 11:39:03 +03:00
ea1da4a69e
Use HTML5 article tag for blog post summaries
See: https://developer.mozilla.org/en/docs/Web/HTML/Element/article
2016-08-29 16:24:14 +03:00
f76b5a069a
layouts: Improve usage of datetime
Use the date format from the config, and print it in a time tag.

See: https://golang.org/pkg/time/
2016-08-28 22:15:16 +03:00
2bb1d6ecc0
First commit with initial theme
Some file are empty (created by `hugo new theme`), but I've left
them for reference later.
2016-08-28 16:22:32 +03:00