Hi. I have a new project and it’s been a long time since I’ve used Hugo; some things have changed since. I would like, if possible, to get some feedback on my draft layout.
The website will be fairly simple. I just want to publish the lecture notes of some of my courses. The index page displays the possible courses in a mosaic/grid; there is one page per course; and there is in addition an “About” webpage. That’s it. Pretty straightforward, and I intend to write the CSS and layouts myself, so I believe I do not need a theme.
My proposed layout is the following:
archetypes/
course.md
assets/
main.css
course.css
content/
courses/
course-1/
index.md
lecture-notes.pdf
exercises.pdf
course-2/
index.md
lecture-notes.pdf
exam.pdf
...
about.md
_index.md
data/
i18n/
layouts/
_default/
baseof.html
home.html
list.html
single.html
partials/
head/
css.html
js.html
footer.html
header.html
head.html
menu.html
terms.html
about.html
course.html
index.html
static/
themes/
hugo.toml
Features to use:
-
As the CSS is located in the
assets
directory, use pipes to use the stylesheet. -
I can actually write Sass instead of pure CSS. For that, the Sass (written either as SCSS or indented) needs to be piped to the function that transpiles it to CSS.
-
Each courses is attached with course material (PDF files). I organize the courses as leaf page bundles; the PDF files are stored in the course’s directory, and not in
assets/
. -
Use base and partial templates. Here, I reused the layout of a dummy theme created with
hugo new theme
.-
All pages use
layouts/_default/baseof.html
. As I only have one section, I only need to have one definition for “list templates”, so I don’t definelayouts/_default/list.html
. In my case, I also don’t needlayouts/_default/single.html
. As far as as the index is concerned, my understanding is that it used to belayouts/index.html
, but it should now belayouts/_defaults/home.html
. -
For the partials, I don’t in my case need
terms.html
,head/js.html
; I can just remove those.
-
Maybe:
- Add some PostCSS processing to ensure compatibility with the most browsers.
Do you agree with my plan, or are there things I should do in a different way? Also, any general recommandation would be appreciated.
Many thanks for making this forum so helpful every time people ask something on it.