80 lines
2.0 KiB
Markdown
80 lines
2.0 KiB
Markdown
# Build Notes for Hugo
|
|
|
|
## _ALL OF THESE COMMANDS SHOULD BE RUN FROM YOUR MAIN FOLDER - THE SAME ONE THAT CONTAINS THE HUGO.YAML_
|
|
|
|
TODO: Create script that loads submodules and theme after downloading git repo for first time.
|
|
|
|
Upon first git clone AND if you want to build the submodules from scratch:
|
|
|
|
```bash
|
|
git rm -rf --caches themes/
|
|
git submodule add https://gitlab.com/Roneo/hugo-shortcode-roneo-collection.git themes/hugo-shortcode-roneo-collection
|
|
git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
|
|
```
|
|
|
|
You can also try to run the git submodule update command, but this hasn't worked for me in the past.
|
|
|
|
```bash
|
|
git submodule update --init --recursive # needed when you reclone your repo (submodules may not get cloned automatically)
|
|
```
|
|
|
|
For some Macs (for instance the 8GB M1), you have to run this to prevent the "too many open files" error:
|
|
|
|
```bash
|
|
hugo check ulimit
|
|
sudo sysctl -w kern.maxfiles=65536
|
|
sudo sysctl -w kern.maxfilesperproc=65536
|
|
ulimit -n 65536 65536
|
|
```
|
|
|
|
Run local:
|
|
|
|
```bash
|
|
hugo server --baseURL 'localhost' --bind 'localhost'
|
|
```
|
|
|
|
And run local with drafts:
|
|
|
|
```bash
|
|
hugo server --buildDrafts --baseURL 'localhost' --bind 'localhost'
|
|
```
|
|
|
|
Build to public folder ready for git push:
|
|
|
|
```bash
|
|
hugo -s ./ -d ./public/
|
|
```
|
|
|
|
## CONTENT
|
|
|
|
Create content with the most used settings
|
|
FEAT: Shouldn't this just become the default one instead of having a more specific command?
|
|
```bash
|
|
hugo new content --kind page posts/name_of_post.md
|
|
```
|
|
|
|
## DESIGN
|
|
|
|
When using the shortcodes from Roneo for Box and/or the detail (drop down/accordion style menu), the formatting can clash
|
|
with the theme. So you'll want to remove box shadow, border, background, padding, etc. Here's the basic setup I insert at the
|
|
end of each MD post that needs these changes.
|
|
```html
|
|
<style>
|
|
.box-shortcode {
|
|
color: #e8e8e8;
|
|
border: none;
|
|
}
|
|
.post-content img {
|
|
margin: auto
|
|
}
|
|
details {
|
|
margin: 0;
|
|
padding: 0;
|
|
border: none;
|
|
background: transparent;
|
|
box-shadow: none;
|
|
}
|
|
</style>
|
|
|
|
```
|