leoncvlt / loconotion

📄 Python tool to turn Notion.so pages into lightweight, customizable static websites
839 stars 132 forks source link

Putting different things in different folders. Images, css, js #36

Open aahnik opened 3 years ago

aahnik commented 3 years ago

When I run loconotion it produces everything in a subfolder of dist.

If everything was organized, it would be great. Like the folder structure could be like this:

- index.html
- images
- css
- js
- pages
aahnik commented 3 years ago

i tried to solve this issue by making a script

the python script does the following:

i expected it to work, but on opening the html files, the images/css/js are not loaded.

So, i tested my script on some other directory (with some files made up by me), it works there. but not in the loconotion.

something weird is happening, that i am not understanding

what mistake am i making ?

@leoncvlt

aahnik commented 3 years ago

@leoncvlt, I made a script that does the job.

Link: https://gist.github.com/aahnik/2c18af0ee937bb2947873774f069adc4

(download it to any path of your choice. lets say /path/to/locorg.py)

How to use ?

  1. Use loconotion normally.

  2. Move inside the output folder (a subfolder inside dist)

  3. If you run ls you should see lots of css,js,woff files and also the html files

  4. Now run locorg.py from inside this directory (like python /path/to/locorg.py)

  5. You get a clean output

  6. Html files do not break (as they are updated)

Before:

image

After:

image

aahnik commented 3 years ago

@leoncvlt, it would be great if you integrate my script into loconotion, and make it a default feature.

as many people are using github pages, all files in the root directory of the repo, look extremely clumsy.

after applying my script, everything gets organized like this:

image

aahnik commented 3 years ago

fixed the #46 font issue in locorg.py