Skip to content

Commit

Permalink
add the latest config
Browse files Browse the repository at this point in the history
  • Loading branch information
roumail committed Oct 19, 2023
1 parent 22aa1bc commit 85cc75e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ paginate: 10
enableEmoji: true
enableRobotsTXT: true
footnotereturnlinkcontents: <sup>^</sup>
ignoreFiles: [ "\.qmd$", "\.py","\.R",\.ipynb$, .ipynb_checkpoints$, \.Rmd$, \.Rmarkdown$, _cache$]
ignoreFiles: [ \.qmd$, \.py$, \.R$,\.ipynb$, .ipynb_checkpoints$, \.Rmd$, \.Rmarkdown$, _cache$]
permalinks:
# event: '/talk/:slug/'
tags: '/tag/:slug/'
Expand Down
8 changes: 5 additions & 3 deletions tasks/posts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import re
from datetime import datetime

from pathlib import Path
from invoke import task


Expand Down Expand Up @@ -58,15 +58,17 @@ def new_post(c, title, series=None, quarto=False):
os.makedirs(post_dir, exist_ok=True)

# Determine the file extension based on the quarto flag
file_ext = ".qmd" if quarto else ".md"
path2post = f"{post_dir}/index{file_ext}"
path2post = Path(f"{post_dir}/index.md")

# Create the new Hugo blog post
c.run(f"hugo new --kind blog-post {path2post}")
print(f"New post created at {path2post}")

# Add Quarto specific format specifications if quarto flag is enabled
if quarto:
path2post_qmd = path2post.with_suffix('.qmd')
path2post.rename(path2post_qmd)
path2post = path2post_qmd
with open(path2post, "a") as f:
f.write("\nformat: hugo-md\njupyter: python3\n")

Expand Down

0 comments on commit 85cc75e

Please sign in to comment.