Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add infrastructure for blogging (#8) #12

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.124.1'
hugo-version: '0.139.0'
extended: true

- name: Build Main
Expand All @@ -36,7 +36,7 @@ jobs:
run: hugo --baseURL=$DEV_SITE --minify

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
60 changes: 60 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Contributing to the website

This website uses Hugo as a static site generator and is hosted on GitHub Pages. To contribute to the website, you will need to install and configure:

1. Git
1. Go
1. Hugo

Fork this repository and clone your fork onto your local machine to make modifications.

Test the site and your modifications locally by running:

```zsh
➜ ~ hugo server -D
```

The `-D` option will show you pages still in draft mode.

## Writing a blog for the TLA+ website

If you would like to write a blog for the TLA+ website, follow these steps:

1. Create a new markdown file using the blog archetype by running:

```zsh
➜ ~ hugo new --kind blog blog/<blog title>/_index.md
```

This `_index.md` file will be prepopulated with the following markdown frontmatter:

```markdown
+++
type = "blog"
menuPre = " "
title = 'blog title'
linkTitle = ''
description = ""
date = <date that you ran the hugo new command>
draft = true
+++
```
2. Change the information in the `title`, `linkTitle`, and `description` to fit your content.

3. Below the last `+++`, write your content normally in markdown.

4. Preview your blog entry anytime by running:

```zsh
➜ ~ hugo server -D
```

5. Once you are happy with your blog entry, take it out of draft mode by changing the flag in the frontmatter:

```markdown
draft = false
```

6. Contribute your blog post upstream to this repository using the normal pull request mechanism.

While this website does not make use of all features available in the [Hugo Relearn theme](https://github.com/McShelby/hugo-theme-relearn), you can read its [documentation to learn more](https://mcshelby.github.io/hugo-theme-relearn/index.html).
9 changes: 9 additions & 0 deletions archetypes/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
+++
type = "blog"
menuPre = " "
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
linkTitle = ''
description = ""
date = {{ .Date }}
draft = true
+++
1 change: 1 addition & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
+++
type = "default"
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
linkTitle = ''
description = ""
Expand Down
2 changes: 1 addition & 1 deletion archetypes/grant.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
+++
type = "default"
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
linkTitle = ''
description = ""
archetype = "grant"
date = {{ .Date }}
draft = true
+++
5 changes: 0 additions & 5 deletions archetypes/section-index.md

This file was deleted.

11 changes: 11 additions & 0 deletions archetypes/section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
+++
type = "default"
menuPre = " "
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
linkTitle = ''
weight = 1
alwaysopen = false
hideifempty = true
+++

{{% children containerstyle="div" style="h2" description=true %}}
5 changes: 5 additions & 0 deletions assets/css/theme-tlaplus.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ body.main-width-max:not(.print) #R-body .narrow .flex-block-wrapper {
position: relative;
}
article {
display: flex;
flex-direction: column;
min-height: 100%;
}
Expand All @@ -160,3 +161,7 @@ footer {
flex-shrink: 0;
padding-bottom: .5rem;
}

.blog-container {
flex-grow: 1;
}
10 changes: 10 additions & 0 deletions content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
type="default"
menuPre = "<i class='fa-fw fas fa-blog'></i> "
title = "TLA+ Blog"
weight = 1
alwaysopen = false
hideifempty = true
+++

{{% children containerstyle="div" style="h2" description=true %}}
1 change: 1 addition & 0 deletions content/grants/2024-grant-program.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
+++
menuPre = "<i class='fa-fw fas fa-scroll'></i> "
title = 'TLA+ Foundation Grant Program Call for Proposals'
linkTitle = 'TLA+ Foundation Grant Program Call for Proposals'
description = "The 2024 TLA+ Foundation Grant Program is aimed at advancing the state of the art in the TLA+ specification and fostering the experience of using TLA+ in research and industry. Depending on the scope of proposed work, grants may range from USD$1000 to USD$100,000. Applicants who receive grants are expected to complete their work within one year, though exceptions may be made on a case-by-case basis."
Expand Down
10 changes: 7 additions & 3 deletions content/grants/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
+++
archetype = "section-index"
type= "default"
menuPre = "<i class='fa-fw fas fa-building-columns'></i> "
title = "TLA+ Foundation Grants"
weight = 1
alwaysopen = "true"
weight = 2
alwaysopen = true
hideifempty = true
+++

{{% children containerstyle="div" style="h2" description=true %}}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github/tlaplus/foundation

go 1.22.1

require github.com/McShelby/hugo-theme-relearn v0.0.0-20240507204003-21b4289ecf44 // indirect
require github.com/McShelby/hugo-theme-relearn v0.0.0-20241118130711-6cb54ccb05c2 // indirect
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/McShelby/hugo-theme-relearn v0.0.0-20240507204003-21b4289ecf44 h1:AKT4XmMcPBvNx6/aIjCMZxKj7Gwl1j7CSJLszuyRRLc=
github.com/McShelby/hugo-theme-relearn v0.0.0-20240507204003-21b4289ecf44/go.mod h1:mKQQdxZNIlLvAj8X3tMq+RzntIJSr9z7XdzuMomt0IM=
github.com/McShelby/hugo-theme-relearn v0.0.0-20241118130711-6cb54ccb05c2 h1:cg1nWrSarc38tRJv+iAICOqB0tj7gf3FDxvcR8bDpVc=
github.com/McShelby/hugo-theme-relearn v0.0.0-20241118130711-6cb54ccb05c2/go.mod h1:mKQQdxZNIlLvAj8X3tMq+RzntIJSr9z7XdzuMomt0IM=
27 changes: 27 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ staticDir = ['static']
disableLandingPageButton = false
disableNextPrev = true
disableSearch = true
disableShortcutsTitle = false
[Params.Author]
Name = "TLA+ Foundation"
[Params.ThemeVariant]
Expand All @@ -21,6 +22,32 @@ staticDir = ['static']
[markup.goldmark.renderer]
unsafe = true

[menu]
[[menu.shortcuts]]
pre = '<i class="fa-fw fab fa-github"></i> '
name = 'GitHub'
url = 'https://github.com/tlaplus/'
weight = 10

[[menu.shortcuts]]
pre = '<i class="fa-fw fas fa-at"></i> '
name = 'Mailing List'
url = 'https://groups.google.com/g/tlaplus/'
weight = 30

[[menu.shortcuts]]
pre = '<i class="fa-fw fas fa-inbox"></i> '
name = 'Mailing List Archive'
url = 'https://discuss.tlapl.us/'
weight = 40

[[menu.shortcuts]]
pre = '<i class="fa-fw fas fa-calendar-day"></i> '
name = 'Conferences and Events'
url = 'https://conf.tlapl.us/home/'
weight = 50


[module]
[[module.imports]]
path = 'github.com/McShelby/hugo-theme-relearn'
13 changes: 13 additions & 0 deletions layouts/blog/views/article.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

<article class="default">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
<div class="blog-container">
{{ partial "article-content.html" . }}
</div>
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>
Empty file.
1 change: 0 additions & 1 deletion layouts/partials/archetypes/grant/styleclass.html

This file was deleted.

11 changes: 0 additions & 11 deletions layouts/partials/archetypes/section-index/article.html

This file was deleted.

1 change: 0 additions & 1 deletion layouts/partials/archetypes/section-index/styleclass.html

This file was deleted.

Loading