Giter Site home page Giter Site logo

obsidian_to_hugo's Introduction

obsidian_to_hugo

Obsidian wikilink, img, video to hugo ref, figure, video.
Tested on Windows 11(Supporting Windows!)

Usage

python convert.py

Feature

Obsidian wikilink, img, video to hugo ref, figure, video. Refer to Demo below.

Only obsidian attachments which is mentioned on content is copied to hugo attachment folder.

Hugo Content, Hugo Attachments, Obsidian Attachments, Obsidian Contents, ..., everything is not removed by running this program.
It do not execute removal command.
But override by copy can be occured. If you misuse this several time(e.g. changing file name and run this several time) there may exist many unused files, so be cautious about this.

Arguments

    parser.add_argument("--hugo-dir", default = Path("../blog"))
    parser.add_argument("--hugo-content-dir", default = Path("../blog/content/post/"))
    parser.add_argument("--hugo-attachments-dir", default = Path("../blog/static/attachments/"))
    parser.add_argument("--obsidian-content-dir", default = Path("./blog/"))
    parser.add_argument("--obsidian-attachments-dir", default = Path("./Attachments/"))

configure obsidian attachment folder and hugo attachment folder path by your own. It will be copied to hugo_attachments_dir.

Example: "./Attachments/1.png" to "../blog/static/attachments/1.png"

Warning

Only image and video is supported for ![[~~]]. If it is not image, it is assumed to be video, even if it isn't.

File attachment is not supported for now. I've searched this hugo shortcode, and considering this to implement.

Demo

Input

[[test2]]
![[Trim.mp4]]
![[Pasted image 20220524212151.png]]

Output

[test2]({{< ref "test2" >}})
{{< video src="/attachments/Trim.mp4" >}}
{{< figure src="/attachments/Pasted image 20220524212151.png" alt="Pasted image 20220524212151.png" >}}

Thanks to

https://github.com/devidw/obsidian-to-hugo/

obsidian_to_hugo's People

Contributors

milkclouds avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.