Forked cosmicflow.space from cosmicpirates.space

This commit is contained in:
zaimon 2024-08-17 23:54:55 +05:30
parent dc31e6399c
commit 0ce84aa48e
99 changed files with 2365 additions and 1226 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/public/
/.packages/
/.org-cache/

View file

@ -1,14 +1,14 @@
# cosmicpirates.space
This is the source code of the cosmicpirates.space website
This is the source code of the cosmicflow website
## Quickstart
Currently in the cosmicpirates.space source can ge accessed on our private [Gitea](https://about.gitea.com/) server.
Currently in the cosmicflow.space source can ge accessed on our private [Gitea](https://about.gitea.com/) server.
### Step 1 : SSH into the cosmicpirates server with forward tunnel of port 3000 to your local port 3000
ssh into the server and forward the port on which Gitea is running(in our case port 3000) into our local port 3000
```console
ssh -L 3000:localhost:3000 pirate@cosmicpirates.space
ssh -L 3000:localhost:3000 fluid@cosmicflow.space
```
### Step 2: Open Gitea on your Browser
Open http://localhost:3000/ in your browser

1051
assets/css/code.css Normal file

File diff suppressed because it is too large Load diff

449
assets/css/site.css Normal file
View file

@ -0,0 +1,449 @@
/*
* Globals
*/
::root {
box-sizing: border-box;
}
html {
font-size: 12px;
}
@media screen and (max-width: 767px) {
html {
font-size: 16px;
}
.logo {
max-width: 270px;
}
.row .column:not(:last-child) {
margin-bottom: 1rem;
}
.video {
width: 100%;
}
.list-form {
width: 90%;
}
.newsletter-text {
font-size: 0.65rem;
}
}
/* sm */
@media screen and (min-width: 768px) {
html {
font-size: 13px;
}
.logo {
max-width: 200px;
}
.row {
display: flex;
flex-direction: row;
padding: 0;
width: 100%;
}
.row .column {
display: block;
flex: 1 1 auto;
max-width: 100%;
width: 100%;
}
.row .column:not(:last-child) {
margin-right: 10px;
}
.align-right {
text-align: right;
}
.video {
width: 70%;
}
.list-form {
width: 60%;
}
.newsletter-text {
font-size: 1.2rem;
}
}
/* md */
@media screen and (min-width: 992px) {
html {
font-size: 15px;
}
.logo {
max-width: 300px;
}
}
/* lg */
@media screen and (min-width: 2560px) {
html {
font-size: 18px;
}
}
body {
margin: 0;
font-family: "Iosevka Aile Web", sans-serif;
font-weight: 300;
font-size: 1.3rem;
line-height: 1.5;
color: #eeffff;
background-color: #000000;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
b {
font-weight: 800;
}
blockquote {
font-style: italic;
}
.container {
margin-right: auto;
margin-left: auto;
padding-right: 0.75rem;
padding-left: 0.75rem;
}
.nav {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Iosevka Aile Web", sans-serif;
font-weight: 600;
line-height: 1.2;
margin-top: 1.3rem;
margin-bottom: 0.5rem;
color: #ff11ff;
}
h1 {
color: #e9a4ee;
}
h2 {
color: #c11146;
}
h3 {
color: #c792ea;
}
h4 {
color: #c3e88d;
}
a {
/* color: #c3e88d; */
color: #82aaff;
}
a:hover,
a:focus {
color: #82aaff;
}
.anchor {
color: #292d3e;
float: left;
padding-right: 4px;
margin-left: -23px;
}
.anchor:hover {
text-decoration: none;
}
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor {
color: inherit;
}
kbd {
font-family: "JetBrains Mono", monospace;
font-weight: 200;
}
pre {
font-family: "JetBrains Mono", monospace;
background-color: #232635;
padding: 1em;
overflow-x: scroll;
}
code {
color: #c3e88d;
}
pre,
code {
font-family: "JetBrains Mono", monospace;
font-weight: 200;
font-size: 1rem;
}
strong {
font-weight: 700;
}
/*
* Override Bootstrap's default container.
*/
.container {
max-width: 60rem;
}
/*
* Masthead for nav
*/
.site-masthead {
margin-bottom: 0.5rem;
background-color: rgba(28, 31, 38, 0.5);
border-bottom: 0.05rem solid #e17fd7;
-webkit-box-shadow: inset 0 -0.1rem 0.25rem rgba(0, 0, 0, 0.1);
box-shadow: inset 0 -0.1rem 0.25rem rgba(0, 0, 0, 0.1);
}
.logo {
display: block;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
margin-left: auto;
margin-right: auto;
text-align: center;
}
/* Nav links */
.nav-link {
position: relative;
padding: 0rem;
font-size: 1.3rem;
margin: 0.5rem 1.25rem 0.5rem 0rem;
font-weight: bold;
color: #cdddeb;
}
.nav-link:hover,
.nav-link:focus {
color: #fff;
background-color: transparent;
}
/* Active state gets a caret at the bottom */
.nav-link.active {
color: #fff;
font-weight: bolder;
}
.nav-icon {
float: right;
}
.nav-icons {
width: auto;
}
/*
* Blog name and description
*/
.site-header {
font-family: "Iosevka Aile Web", sans-serif;
font-weight: bold;
background-image: url("/img/header_bg.png");
background-size: cover;
}
.site-title {
margin-bottom: 0;
font-size: 3rem;
font-weight: bold;
color: #82aaff;
}
.site-description {
font-size: 1.5rem;
color: #999;
}
@media (max-width: 40em) {
.site-description {
margin-bottom: 1rem;
}
}
/*
* Site pages
*/
.site-post {
margin-bottom: 2rem;
}
.site-post-title {
margin-bottom: 0.75rem;
font-size: 2.5rem;
}
.site-post-meta {
margin-bottom: 1.25rem;
color: #999;
}
.site-post-tags {
margin-top: 3rem;
margin-bottom: 1.25rem;
font-size: 1.1rem;
color: #999;
}
/*
* Footer
*/
.site-footer {
padding: 1.3rem 0;
margin-top: 1rem;
color: #93309f;
font-size: 1rem;
background-color: #38033a;
border-top: 0.05rem solid #c3e88d;
}
.site-footer p:last-child {
margin-bottom: 0;
}
.site-footer-right {
text-align: right;
}
.video {
position: relative;
overflow: hidden;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.video::after {
display: block;
content: "";
padding-top: 56.25%;
}
.video iframe {
position: absolute;
top: 0;
left: 0;
border: 0;
width: 100%;
height: 100%;
}
.cta {
width: 80%;
padding: 1rem;
margin-top: 1rem;
margin-bottom: 1rem;
border: 1px solid #f78c6c;
border-radius: 4px;
background-color: #232635;
}
.stream-time {
width: 80%;
padding: 1rem;
margin-top: 1rem;
margin-bottom: 1rem;
border: 1px solid #c792ea;
border-radius: 4px;
background-color: #232635;
}
.list-form {
font-size: 0.9rem;
padding: 1rem;
margin-bottom: 1rem;
border: 1px solid #c3e88d;
border-radius: 4px;
background-color: #232635;
}
.list-form-title {
font-family: "Iosevka Aile Web", sans-serif;
font-weight: 600;
font-size: 1.2rem;
margin-bottom: 0.5rem;
color: #c3e88d;
}
.list-form-label {
margin-top: 0.8rem;
font-weight: bold;
}
.list-form input[type="text"] {
width: 100%;
padding: 10px 10px;
margin: 8px 0;
box-sizing: border-box;
border: 1px solid #c3e88d;
border-radius: 4px;
background-color: #232635;
color: #eeffff;
}
.list-form input[type="submit"] {
width: 50%;
padding: 10px 10px;
margin: 8px 0;
box-sizing: border-box;
border: 1px solid #89aaeb;
border-radius: 4px;
background-color: #89aaeb;
color: #232635;
}
.newsletter-text {
}

View file

@ -0,0 +1,382 @@
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 100;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-thin.woff2") format("woff2"),
url("ttf/iosevka-aile-thin.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 100;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-thinoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-thinoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 100;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-thinoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-thinoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 100;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-thinitalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-thinitalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 200;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extralight.woff2")
format("woff2"),
url("ttf/iosevka-aile-extralight.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 200;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extralightoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-extralightoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 200;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extralightoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-extralightoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 200;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extralightitalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-extralightitalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 300;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-light.woff2") format("woff2"),
url("ttf/iosevka-aile-light.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 300;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-lightoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-lightoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 300;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-lightoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-lightoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 300;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-lightitalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-lightitalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 400;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-regular.woff2")
format("woff2"),
url("ttf/iosevka-aile-regular.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 400;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-oblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-oblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 400;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-oblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-oblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 400;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-italic.woff2")
format("woff2"),
url("ttf/iosevka-aile-italic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 500;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-medium.woff2")
format("woff2"),
url("ttf/iosevka-aile-medium.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 500;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-mediumoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-mediumoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 500;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-mediumoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-mediumoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 500;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-mediumitalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-mediumitalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 600;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-semibold.woff2")
format("woff2"),
url("ttf/iosevka-aile-semibold.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 600;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-semiboldoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-semiboldoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 600;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-semiboldoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-semiboldoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 600;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-semibolditalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-semibolditalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 700;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-bold.woff2") format("woff2"),
url("ttf/iosevka-aile-bold.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 700;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-boldoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-boldoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 700;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-boldoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-boldoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 700;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-bolditalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-bolditalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 800;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extrabold.woff2")
format("woff2"),
url("ttf/iosevka-aile-extrabold.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 800;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extraboldoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-extraboldoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 800;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extraboldoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-extraboldoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 800;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-extrabolditalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-extrabolditalic.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 900;
font-stretch: normal;
font-style: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-heavy.woff2") format("woff2"),
url("ttf/iosevka-aile-heavy.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 900;
font-stretch: normal;
font-style: oblique;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-heavyoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-heavyoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web Oblique";
font-display: swap;
font-weight: 900;
font-stretch: normal;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-heavyoblique.woff2")
format("woff2"),
url("ttf/iosevka-aile-heavyoblique.ttf") format("truetype");
}
@font-face {
font-family: "Iosevka Aile Web";
font-display: swap;
font-weight: 900;
font-stretch: normal;
font-style: italic;
src: url("/fonts/iosevka-aile/woff2/iosevka-aile-heavyitalic.woff2")
format("woff2"),
url("ttf/iosevka-aile-heavyitalic.ttf") format("truetype");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,76 @@
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-Bold-Italic.woff2")
format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-Bold-Italic.woff") format("woff");
font-weight: 700;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-Bold.woff2") format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-Bold.woff") format("woff");
font-weight: 700;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-ExtraBold-Italic.woff2")
format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-ExtraBold-Italic.woff")
format("woff");
font-weight: 800;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-ExtraBold.woff2")
format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-ExtraBold.woff") format("woff");
font-weight: 800;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-Italic.woff2") format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-Italic.woff") format("woff");
font-weight: 400;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-Medium-Italic.woff2")
format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-Medium-Italic.woff") format("woff");
font-weight: 500;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2") format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "JetBrains Mono";
src: url("/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2") format("woff2"),
url("/fonts/jetbrains-mono/JetBrainsMono-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

BIN
assets/pics/header_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

BIN
assets/pics/sc_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

BIN
assets/pics/sc_logo_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 MiB

View file

@ -1,7 +1,3 @@
#+title: About
#+created: [2024-03-02 Sat]
#+setupfile: main.setup
#+begin_center
: +--------------------------------------+
: | ___ _ _ |
@ -13,12 +9,6 @@
: +--------------------------------------+
#+end_center
#+name: link-list
|------+-------+-------+-----+------+-----+-------|
| [[file:index.org][Home]] | [[file:blogs/blog-index.org][Blogs]] | [[file:about.org][About]] | [[file:FAQ.org][FAQ]] | [[file:news.org][News]] | [[file:contact.org][PGP]] | [[file:links.org][Links]] |
|------+-------+-------+-----+------+-----+-------|
My name is Dibyashanu Pati, I like Physics, Mathematics, Astronomy and Computers.
We think that knowledge should be open to everyone and freely accessible.
This website will document our projects, interests and ideas.

View file

@ -1,8 +1,3 @@
#+title: Blogs List
#+created: [2024-03-01 Fri]
#+OPTIONS: num:nil ^:{} title:nil toc:nil
#+setupfile: ../main.setup
#+begin_center
: +-----------------------------------------------------+
: |oooooooooo. oooo |
@ -17,13 +12,10 @@
: +-----------------------------------------------------+
#+end_center
[[../index.org][Home]]
* A list of All Blogs
#+name: blog-table-complete
|-
|Title|Last Modified|Created|
|-
|[[file:test_blog_3.org][Test Blog]]||[2024-02-05 Thu]|
|-----------+------------------+------------------|
| Title | Last Modified | Created |
|-----------+------------------+------------------|
| [[/test_blog][Test Blog]] | [2024-08-17 Sat] | [2024-08-17 Sat] |

View file

@ -1,4 +0,0 @@
|-
|Title|Last Modified|Created|
|-
|[[file:test_blog_3.org][Test Blog]]||[2024-02-05 Thu]|

View file

@ -1,46 +0,0 @@
# -*- mode: org; -*-
# These are the options for blog pages
# title is automatically set to blog name
#+OPTIONS: num:nil ^:{} toc:nil
The following are the html customiation options
Setting the background color to black
#+HTML_HEAD:<style> body { background-color: #000000; color: #eeeeee;border 5px; padding 5px} </style>
#+HTML_HEAD:<style> pre { background-color: #000000; } </style>
* Margins
** p
#+HTML_HEAD:<style>
#+HTML_HEAD: p {
#+HTML_HEAD: margin-top: 20px;
#+HTML_HEAD: margin-bottom: 20px;
#+HTML_HEAD: margin-left: 30px;
#+HTML_HEAD: margin-right: 30px;
#+HTML_HEAD: }
#+HTML_HEAD:</style>
** h2
#+HTML_HEAD:<style>
#+HTML_HEAD: h2 {
#+HTML_HEAD: margin-top: 20px;
#+HTML_HEAD: margin-bottom: 20px;
#+HTML_HEAD: margin-left: 10px;
#+HTML_HEAD: margin-right: 10px;
#+HTML_HEAD: }
#+HTML_HEAD:</style>
Alligning center blocks to the center
#+HTML_HEAD:<style> .org-center {text-align: center;} </style>
Setting up tables to always be in the center
#+HTML_HEAD:<style> table { margin-left: auto; margin-right:auto; } </style>
Setting up the h2(main) heading
#+HTML_HEAD:<style> h2 {font-size: 35px; color: #a3373c;} </style>
Setting up the h3 heading
#+HTML_HEAD:<style> h3 {font-size: 30px; color: #3778a3; text-align: center;} </style>
#+HTML_HEAD:

View file

@ -11,12 +11,6 @@
#+end_center
#+name: link-list
|------+-------+-------+-----+------+-----+-------|
| [[file:index.org][Home]] | [[file:blogs/blog-index.org][Blogs]] | [[file:about.org][About]] | [[file:FAQ.org][FAQ]] | [[file:news.org][News]] | [[file:contact.org][PGP]] | [[file:links.org][Links]] |
|------+-------+-------+-----+------+-----+-------|
* Dibyashanu Pati
#+begin_center
: ┌─┐ ┌┬┐ ┌─┐ ┬ ┬
@ -84,68 +78,3 @@ Uwr5q7YlZSsd+DyyEU6tpNO98Afjk+0=
-----END PGP PUBLIC KEY BLOCK-----
#+end_src
* Pranav Kalsi
#+begin_center
: ┌─┐ ┌┬┐ ┌─┐ ┬ ┬
: ├┤ │││ ├─┤ │ │
: └─┘ ┴ ┴ ┴ ┴ ┴ ┴─┘
: ┌─┐ ┬─┐ ┌─┐ ┌┐┌ ┌─┐ ┬ ┬ ┬┌─ ┌─┐ ┬ ┌─┐ ┬ ┌─┐ ┌─┐ ┬─┐ ┌─┐ ┌┬┐ ┌─┐ ┌┐┌ ┌┬┐ ┌─┐
: ├─┘ ├┬┘ ├─┤ │││ ├─┤ └┐┌┘ ├┴┐ ├─┤ │ └─┐ │ │└┘ ├─┘ ├┬┘ │ │ │ │ │ │││ │││ ├┤
: ┴ ┴└─ ┴ ┴ ┘└┘ ┴ ┴ └┘ ┴ ┴ ┴ ┴ ┴─┘ └─┘ ┴ └── ┴ ┴└─ └─┘ ┴ └─┘ ┘└┘ o ┴ ┴ └─┘
#+end_center
** PGP Keys
#+begin_src
-----BEGIN PGP PUBLIC KEY BLOCK-----
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
=OaHj
-----END PGP PUBLIC KEY BLOCK-----
#+end_src

5
content/credits.org Normal file
View file

@ -0,0 +1,5 @@
#+title: Credits
This website is created with [[https://orgmode.org/][Org mode]] in [[https://www.gnu.org/software/emacs/][GNU Emacs]] and is heavily influenced by the source code David Wilson's website [[https://systemcrafters.net/][System Crafters]].
I also thank my friends Sidak Singh Grewal and Pranav Kalsi for bullying me into making this website.

View file

@ -1,21 +1,10 @@
#+TITLE: Home
#+TITLE: Welcome to cosmicflow
#+created: [2024-03-01 Fri]
#+setupfile: main.setup
#+begin_center
: +------------------------------------------------------------------------------------------------------------------------+
: | ██████╗ ██████╗ ███████╗ ███╗ ███╗ ██╗ ██████╗ ██████╗ ██╗ ██████╗ █████╗ ████████╗ ███████╗ ███████╗ |
: | ██╔════╝ ██╔═══██╗ ██╔════╝ ████╗ ████║ ██║ ██╔════╝ ██╔══██╗ ██║ ██╔══██╗ ██╔══██╗ ╚══██╔══╝ ██╔════╝ ██╔════╝ |
: | ██║ ██║ ██║ ███████╗ ██╔████╔██║ ██║ ██║ █████╗ ██████╔╝ ██║ ██████╔╝ ███████║ ██║ █████╗ ███████╗ |
: | ██║ ██║ ██║ ╚════██║ ██║╚██╔╝██║ ██║ ██║ ╚════╝ ██╔═══╝ ██║ ██╔══██╗ ██╔══██║ ██║ ██╔══╝ ╚════██║ |
: | ╚██████╗ ╚██████╔╝ ███████║ ██║ ╚═╝ ██║ ██║ ╚██████╗ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ███████╗ ███████║ |
: | ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ |
: +------------------------------------------------------------------------------------------------------------------------+
#+end_center
Cosmicflow is a site devoted to the interests of Dibyashanu Pati.
I'm currently a student, I love Physics, Mathematics, Astronomy and Computers.
#+name: link-list
|------+-------+-------+-----+------+-----+-------|
| [[file:index.org][Home]] | [[file:blogs/blog-index.org][Blogs]] | [[file:about.org][About]] | [[file:FAQ.org][FAQ]] | [[file:news.org][News]] | [[file:contact.org][PGP]] | [[file:links.org][Links]] |
|------+-------+-------+-----+------+-----+-------|

View file

@ -1,9 +1,3 @@
#+title: Links
#+created: [2024-03-06 Wed]
#+last_modified: [2024-03-06 Wed]
#+setupfile: main.setup
#+HTML_HEAD:<style>
#+HTML_HEAD: h2 {
#+HTML_HEAD: margin-top: 30px;
@ -28,18 +22,8 @@
: +------------------------------------------+
#+end_center
#+name: link-list
|------+-------+-------+-----+------+-----+-------|
| [[file:index.org][Home]] | [[file:blogs/blog-index.org][Blogs]] | [[file:about.org][About]] | [[file:FAQ.org][FAQ]] | [[file:news.org][News]] | [[file:contact.org][PGP]] | [[file:links.org][Links]] |
|------+-------+-------+-----+------+-----+-------|
#+TOC: headlines 1
* cosmicpirates.space
** Clearnet
https://cosmicpirates.space/
** TOR
#+name: tor-onionv3-address.txt
Not found

View file

@ -1,58 +0,0 @@
# -*- mode: org; -*-
# These are the options for a main page
# The Title is expected to be provided individually at the head of each file for pages with main type
#+startup: overview
* Org defualts
#+OPTIONS: num:nil ^:{} title:nil toc:nil
* HTML
The following are the html customiation options
** Setting the background color to black and Margins
#+HTML_HEAD:<style> body { background-color: #000000; color: #eeeeee; } </style>
#+HTML_HEAD:<style> pre { background-color: #000000;color: #ffd700;border: 5px double #569b9e ;padding 5px} </style>
** Seting up tags
*** p
#+HTML_HEAD:<style>
#+HTML_HEAD: p {
#+HTML_HEAD: margin-top: 20px;
#+HTML_HEAD: margin-bottom: 20px;
#+HTML_HEAD: margin-left: 30px;
#+HTML_HEAD: margin-right: 30px;
#+HTML_HEAD: text-align: center;
#+HTML_HEAD: }
#+HTML_HEAD:</style>
*** h2
#+HTML_HEAD:<style>
#+HTML_HEAD: h2 {
#+HTML_HEAD: margin-top: 100px;
#+HTML_HEAD: margin-bottom: 20px;
#+HTML_HEAD: margin-left: 10px;
#+HTML_HEAD: margin-right: 10px;
#+HTML_HEAD: font-size: 35px;
#+HTML_HEAD: color: #a3373c;
#+HTML_HEAD: text-align: center;
#+HTML_HEAD: padding 5px;
#+HTML_HEAD: }
#+HTML_HEAD:</style>
*** Setting up the h3 heading
#+HTML_HEAD:<style>
#+HTML_HEAD: h3 {font-size: 30px;
#+HTML_HEAD: color: #3778a3;
#+HTML_HEAD: text-align: center;
#+HTML_HEAD: }
#+HTML_HEAD: </style>
*** table of contents
#+HTML_HEAD:<style> #table-of-contents { background-color: #10100c; color: #eeeeee;max-width: 30em; } </style>
** Alligning center blocks to the center
#+HTML_HEAD:<style> .org-center {text-align: center;} </style>
** Setting up tables to always be in the center
#+HTML_HEAD:<style> table { margin-left: auto; margin-right:auto; } </style>

View file

@ -1,8 +1,3 @@
#+title: News
#+created: [2024-03-01 Fri]
#+last_modified: [2024-03-06 Wed]
#+setupfile: main.setup
#+begin_center
: +--------------------------------------+
: | _ _ |
@ -13,12 +8,4 @@
: +--------------------------------------+
#+end_center
#+name: link-list
|------+-------+-------+-----+------+-----+-------|
| [[file:index.org][Home]] | [[file:blogs/blog-index.org][Blogs]] | [[file:about.org][About]] | [[file:FAQ.org][FAQ]] | [[file:news.org][News]] | [[file:contact.org][PGP]] | [[file:links.org][Links]] |
|------+-------+-------+-----+------+-----+-------|
* TOR and I2P - [2024-03-06 Wed]
Went live on I2P
#+name: i2p-b32-address.txt
Not found
* Created this site from scratch - [2024-08-17 Sat]

View file

@ -0,0 +1,3 @@
#+title: Privacy Policy
I *do not* intentionally collect any data of visitors.

1
content/source_code.org Normal file
View file

@ -0,0 +1 @@
Coming Soon

View file

@ -1 +0,0 @@
http://dbtjoqs5jnsyq6m6r35a47jix2v4zeloz5fpxi6htwihpnv3fcxq.b32.i2p

View file

@ -1 +0,0 @@
http://acfc2abqv65bdiwimrx74vrlxy6eel66cjlmgqqvdekcrx7ufl3c2cad.onion

View file

@ -1,7 +1,6 @@
#+title: Test Blog
#+created: [2024-02-05 Thu]
#+last_modified:
#+setupfile: blog.setup
#+created: [2024-08-17 Sat]
#+last_modified: [2024-08-17 Sat]
#+author: Dibyashanu Pati
* Introduction

428
create-site.el Normal file → Executable file
View file

@ -3,6 +3,7 @@
(require 'package)
(setq package-user-dir (expand-file-name "./.packages"))
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")))
;; Initialize the package system
@ -10,6 +11,19 @@
(unless package-archive-contents
(package-refresh-contents))
;; Install use-package
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
;;; see these later
;; Require built-in dependencies
(require 'vc-git)
(require 'ox-publish)
(require 'subr-x)
(require 'cl-lib)
;; Install dependencies
(package-install 'htmlize)
(package-install 'ox-gemini)
@ -20,60 +34,380 @@
(require 'ox-publish)
(use-package ox-gemini)
;; Install other dependencies
(use-package esxml
:pin "melpa-stable"
:ensure t)
(setq org-publish-use-timestamps-flag nil)
(setq org-html-validation-link nil
org-html-head-include-scripts nil
org-html-head-include-default-style nil
org-html-preamble nil
org-html-postamble nil
org-html-use-infojs nil
)
(use-package htmlize
:ensure t)
(use-package webfeeder
:ensure t)
(setq org-publish-project-alist '(
("cosmicpirates-html"
:base-directory "./content"
:base-extension "org"
:publishing-directory "public/cosmicpirates.space-html"
:recursive t
:publishing-function org-html-publish-to-html
;;:with-author nil
;;:with-creator nil
;;:email nil
:with-timestamps nil
)
("cosmicpirates-html-static"
:base-directory "./content/static"
:base-extension "css\\|ttf\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|mp4\\|xml\\|html"
:publishing-directory "./public/cosmicpirates.space-html/static"
:recursive t
:publishing-function org-publish-attachment
)
(defvar yt-iframe-format
(concat "<div class=\"video\">"
" <iframe src=\"https://www.youtube.com/embed/%s\" allowfullscreen></iframe>"
"</div>"))
("cosmicpirates-gmi"
:base-directory "./content"
:base-extension "org"
:publishing-directory "./public/cosmicpirates.space-gmi"
:recursive t
:publishing-function org-gemini-publish-to-gemini
:with-author nil
:with-creator nil
:email nil
:with-timestamps nil
)
(defun my/embed-video (video-id)
(format yt-iframe-format video-id))
("cosmicpirates-gmi-static"
:base-directory "./content/static"
:base-extension "css\\|ttf\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|xml\\|html"
:publishing-directory "./public/cosmicpirates.space-gmi/static"
:recursive t
:publishing-function org-publish-attachment
export txt file as txt file in org html website publish
)
)
(setq user-full-name "Dibyashanu Pati")
(setq user-mail-address "dibyashanu@protonmail.com")
(defvar my/site-url (if (string-equal (getenv "CI") "true")
"https://cosmicflow.space"
"http://localhost:8080")
"The URL for the site being generated.")
(defun my/site-header ()
(list `(header (@ (class "site-header"))
(div (@ (class "container"))
(div (@ (class "site-title"))
(img (@ (class "logo")
(src "/pics/sc_logo.png")
(alt "Cosmicflow")))))
(div (@ (class "site-masthead"))
(div (@ (class "container"))
(nav (@ (class "nav"))
(a (@ (class "nav-link") (href "/")) "Home") " "
(a (@ (class "nav-link") (href "/blogs/")) "Blog") " "
(a (@ (class "nav-link") (href "/about/")) "About") " "
(a (@ (class "nav-link") (href "/contact/")) "PGP") " "
(a (@ (class "nav-link") (href "/links/")) "Links") " "
;; (a (@ (class "nav-link") (href "https://store.systemcrafters.net?utm_source=sc-site-nav")) "Store") " "
(a (@ (class "nav-link") (href "/news/")) "News")))))))
(defun my/site-footer ()
(list `(footer (@ (class "site-footer"))
(div (@ (class "container"))
(div (@ (class "row"))
(div (@ (class "column"))
(p (a (@ (href "/privacy_policy/")) "Privacy Policy")
" · "
(a (@ (href "/credits/")) "Credits")
" · "
(a (@ (href "/source_code/")) "Source Code")
;; " · "
;; (a (@ (rel "me") (href "https://fosstodon.org/@daviwil")) "Fediverse"))
(p "© 2024 Dibyashanu Pati - Except where otherwise noted, this work is licensed under http://creativecommons.org/licenses/by/3.0/"
(img (@ (class "column align-left")
(src "/pics/CCLogoColorPop1.gif")
(style "width: 40px")
(alt "Except where otherwise noted, this work is licensed under http://creativecommons.org/licenses/by/3.0/")))
)
)
)
)))))
(defun get-article-output-path (org-file pub-dir)
(let ((article-dir (concat pub-dir
(downcase
(file-name-as-directory
(file-name-sans-extension
(file-name-nondirectory org-file)))))))
(if (string-match "\\/index.org\\|\\/404.org$" org-file)
pub-dir
(progn
(unless (file-directory-p article-dir)
(make-directory article-dir t))
article-dir))))
(defun my/get-commit-hash ()
"Get the short hash of the latest commit in the current repository."
(string-trim-right
(with-output-to-string
(with-current-buffer standard-output
(vc-git-command t nil nil "rev-parse" "--short" "HEAD")))))
(cl-defun my/generate-page (title
content
info
&key
(publish-date)
(head-extra)
(pre-content)
(exclude-header)
(exclude-footer))
(concat
"<!-- Generated from " (my/get-commit-hash) " on " (format-time-string "%Y-%m-%d @ %H:%M") " with " org-export-creator-string " -->\n"
"<!DOCTYPE html>"
(sxml-to-xml
`(html (@ (lang "en"))
(head
(meta (@ (charset "utf-8")))
(meta (@ (author "Cosmicflow - Dibyashanu Pati")))
(meta (@ (name "viewport")
(content "width=device-width, initial-scale=1, shrink-to-fit=no")))
(link (@ (rel "icon") (type "image/png") (href "/img/favicon.png")))
(link (@ (rel "alternative")
(type "application/rss+xml")
(title "System Crafters News")
(href "/rss/news.xml")))
(link (@ (rel "stylesheet") (href "/fonts/iosevka-aile/iosevka-aile.css")))
(link (@ (rel "stylesheet") (href "/fonts/jetbrains-mono/jetbrains-mono.css")))
(link (@ (rel "stylesheet") (href "/css/code.css")))
(link (@ (rel "stylesheet") (href "/css/site.css")))
;; (script (@ (defer "defer")
;; (data-domain "systemcrafters.net")
;; (src "https://plausible.io/js/plausible.js"))
;; ;; Empty string to cause a closing </script> tag
;; "")
;; ,(when head-extra head-extra)
(title ,(concat title " - Cosmicflow")))
(body ,@(unless exclude-header
(my/site-header))
(div (@ (class "container"))
(div (@ (class "site-post"))
(h1 (@ (class "site-post-title"))
,title)
,(when publish-date
`(p (@ (class "site-post-meta")) ,publish-date))
,(if-let ((video-id (plist-get info :video)))
(my/embed-video video-id))
,(when pre-content pre-content)
(div (@ (id "content"))
,content))
)
,@(unless exclude-footer
(my/site-footer)))))))
(defun my/org-html-template (contents info)
(my/generate-page (org-export-data (plist-get info :title) info)
contents
info
:publish-date (org-export-data (org-export-get-date info "%B %e, %Y") info)))
(defun my/org-html-link (link contents info)
"Removes file extension and changes the path into lowercase file:// links."
(when (and (string= 'file (org-element-property :type link))
(string= "org" (file-name-extension (org-element-property :path link))))
(org-element-put-property link :path
(downcase
(file-name-sans-extension
(org-element-property :path link)))))
(let ((exported-link (org-export-custom-protocol-maybe link contents 'html info)))
(cond
(exported-link exported-link)
((equal contents nil)
(format "<a href=\"%s\">%s</a>"
(org-element-property :raw-link link)
(org-element-property :raw-link link)))
((string-prefix-p "/" (org-element-property :raw-link link))
(format "<a href=\"%s\">%s</a>"
(org-element-property :raw-link link)
contents))
(t (org-export-with-backend 'html link contents info)))))
(defun my/make-heading-anchor-name (headline-text)
(thread-last headline-text
(downcase)
(replace-regexp-in-string " " "-")
(replace-regexp-in-string "[^[:alnum:]_-]" "")))
(defun my/org-html-headline (headline contents info)
(let* ((text (org-export-data (org-element-property :title headline) info))
(level (org-export-get-relative-level headline info))
(level (min 7 (when level (1+ level))))
(anchor-name (my/make-heading-anchor-name text))
(attributes (org-element-property :ATTR_HTML headline))
(container (org-element-property :HTML_CONTAINER headline))
(container-class (and container (org-element-property :HTML_CONTAINER_CLASS headline))))
(when attributes
(setq attributes
(format " %s" (org-html--make-attribute-string
(org-export-read-attribute 'attr_html `(nil
(attr_html ,(split-string attributes))))))))
(concat
(when (and container (not (string= "" container)))
(format "<%s%s>" container (if container-class (format " class=\"%s\"" container-class) "")))
(if (not (org-export-low-level-p headline info))
(format "<h%d%s><a id=\"%s\" class=\"anchor\" href=\"#%s\">¶</a>%s</h%d>%s"
level
(or attributes "")
anchor-name
anchor-name
text
level
(or contents ""))
(concat
(when (org-export-first-sibling-p headline info) "<ul>")
(format "<li>%s%s</li>" text (or contents ""))
(when (org-export-last-sibling-p headline info) "</ul>")))
(when (and container (not (string= "" container)))
(format "</%s>" (cl-subseq container 0 (cl-search " " container)))))))
(defun my/org-html-src-block (src-block _contents info)
(let* ((lang (org-element-property :language src-block))
(code (org-html-format-code src-block info)))
(format "<pre>%s</pre>" (string-trim code))))
(defun my/org-html-special-block (special-block contents info)
"Transcode a SPECIAL-BLOCK element from Org to HTML.
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let* ((block-type (org-element-property :type special-block))
(attributes (org-export-read-attribute :attr_html special-block)))
(format "<div class=\"%s center\">\n%s\n</div>"
block-type
(or contents
(if (string= block-type "cta")
"If you find this guide helpful, please consider supporting System Crafters via the links on the <a href=\"/how-to-help/#support-my-work\">How to Help</a> page!"
"")))))
(org-export-define-derived-backend 'site-html 'html
:translate-alist
'((template . my/org-html-template)
(link . my/org-html-link)
(src-block . my/org-html-src-block)
(special-block . my/org-html-special-block)
(headline . my/org-html-headline))
:options-alist
'((:video "VIDEO" nil nil)))
(defun org-html-publish-to-html (plist filename pub-dir)
"Publish an org file to HTML, using the FILENAME as the output directory."
(let ((article-path (get-article-output-path filename pub-dir)))
(cl-letf (((symbol-function 'org-export-output-file-name)
(lambda (extension &optional subtreep pub-dir)
;; The 404 page is a special case, it must be named "404.html"
(concat article-path
(if (string= (file-name-nondirectory filename) "404.org") "404" "index")
extension))))
(org-publish-org-to 'site-html
filename
(concat "." (or (plist-get plist :html-extension)
"html"))
plist
article-path))))
(defun my/rss-extract-title (html-file)
"Extract the title from an HTML file."
(with-temp-buffer
(insert-file-contents html-file)
(let ((dom (libxml-parse-html-region (point-min) (point-max))))
(dom-text (car (dom-by-class dom "site-post-title"))))))
(defun my/rss-extract-date (html-file)
"Extract the post date from an HTML file."
(with-temp-buffer
(insert-file-contents html-file)
(let* ((dom (libxml-parse-html-region (point-min) (point-max)))
(date-string (dom-text (car (dom-by-class dom "site-post-meta"))))
(parsed-date (parse-time-string date-string))
(day (nth 3 parsed-date))
(month (nth 4 parsed-date))
(year (nth 5 parsed-date)))
;; NOTE: Hardcoding this at 8am for now
(encode-time 0 0 8 day month year))))
(setq webfeeder-title-function #'my/rss-extract-title
webfeeder-date-function #'my/rss-extract-date)
;; (setq org-publish-use-timestamps-flag nil)
;; (setq org-html-validation-link nil
;; org-html-head-include-scripts nil
;; org-html-head-include-default-style nil
;; org-html-preamble nil
;; org-html-postamble nil
;; org-html-use-infojs nil
;; )
(setq org-publish-use-timestamps-flag t
org-publish-timestamp-directory "./.org-cache/"
org-export-with-section-numbers nil
org-export-use-babel nil
org-export-with-smart-quotes t
org-export-with-sub-superscripts nil
org-export-with-tags 'not-in-toc
org-html-htmlize-output-type 'css
org-html-prefer-user-labels t
;; org-html-link-home my/site-url
org-html-link-use-abs-url t
org-html-link-org-files-as-html t
org-html-html5-fancy t
org-html-self-link-headlines t
org-export-with-toc nil
make-backup-files nil)
(setq org-publish-project-alist
(list '("cosmicflow:main"
:base-directory "./content"
:base-extension "org"
:publishing-directory "./public/cosmicflow-html"
:publishing-function org-html-publish-to-html
:with-title nil
;;:with-author nil
;;:with-creator nil
;;:email nil
:with-timestamps nil)
'("cosmicflow:assets"
:base-directory "./assets"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|woff2\\|ttf"
:publishing-directory "./public/cosmicflow-html"
:recursive t
:publishing-function org-publish-attachment)
'("cosmicpirates-gmi"
:base-directory "./content"
:base-extension "org"
:publishing-directory "./public/cosmicflow-gmi"
:recursive t
:publishing-function org-gemini-publish-to-gemini
:with-author nil
:with-creator nil
:email nil
:with-timestamps nil)
;; ("cosmicpirates-gmi-static"
;; :base-directory "./content/static"
;; :base-extension "css\\|ttf\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|xml\\|html"
;; :publishing-directory "./public/cosmicpirates.space-gmi/static"
;; :recursive t
;; :publishing-function org-publish-attachment
;; export txt file as txt file in org html website publish
;; )
)
)
;; (defun my/publish ()
;; "Publish the entire site."
;; (interactive)
;; (org-publish-all (string-equal (or (getenv "FORCE")
;; (getenv "CI"))
;; "true"))
;; (webfeeder-build "rss/news.xml"
;; "./public"
;; my/site-url
;; (let ((default-directory (expand-file-name "./public/")))
;; (remove "news/index.html"
;; (directory-files-recursively "news"
;; ".*\\.html$")))
;; :builder 'webfeeder-make-rss
;; :title "cosmiflow news"
;; :description "News and Insights from Cosmicflow!"
;; :author "Dibyashanu Pati")
;; )
;; publish the websites
(org-publish-all t)

View file

@ -1,13 +1,4 @@
#!/usr/bin/env sh
# update addresses
python scripts/generate_and_update_address_files.py
#Add headings links to all top level files
python scripts/heading-link-generator.py
# Generate the main blog table
python scripts/blog-table-generator.py
# generate the html and gemini versions of the site using org-publish
emacs -Q --script create-site.el
emacs -Q --batch -l create-site.el

616
main.org
View file

@ -1,616 +0,0 @@
#+title: Main
#+startup: overview
* Usage Instructions and Best Practices
** Basic Plan
+ The entire organization of the website is generated by the +scripts in this file+ scripts in the [[file:scripts/]] directory.
+ These scripts generated by this file.
+ To run the scripts in [[file:scripts/]] and to generate the website just run [[file:create.sh]]
** Software and tools
+ python
+ [[https://www.gnu.org/software/emacs/][Emacs]]
** Advice
+ Do not use the #+include tag
Writing dynamic content to files and then using #+include to include them in other files has unreliable link conversion
* Static content and Sample code snippets
** Generating the README.md file
#+begin_src md :tangle README.md
# cosmicpirates.space
This is the source code of the cosmicpirates.space website
## Quickstart
Currently in the cosmicpirates.space source can ge accessed on our private [Gitea](https://about.gitea.com/) server.
### Step 1 : SSH into the cosmicpirates server with forward tunnel of port 3000 to your local port 3000
ssh into the server and forward the port on which Gitea is running(in our case port 3000) into our local port 3000
```console
ssh -L 3000:localhost:3000 pirate@cosmicpirates.space
```
### Step 2: Open Gitea on your Browser
Open http://localhost:3000/ in your browser
Create an account if nessasary(Not required if you just want to view but required if you want to push to a repo).
You should be able to see this project repository at http://localhost:3000/dibyashanu/cosmicpirates.space
### Step 3: Clone the repo
Make a local copy of this repo
```console
git clone http://localhost:3000/dibyashanu/cosmicpirates.space.git
```
Go to the repo directory
```console
cd cosmicpirates.space.
```
Set a username and email - this will be used to track the changes you make to this repository
```console
git config user.name "Your Name Here"
git config user.email "your@email.com"
```
Set the origin to the required location
```console
git remote add origin http://localhost:3000/dibyashanu/cosmicpirates.space.git
```
### Step 4: Make changes to the local version of the repository
Most of the time try only to make changes to the [main.org](./main.org) and generate all other content by either running scripts in this file or runing org-babel-tangle(C-c C-v t in doom emacs).
For more details see [main.org](./main.org)
### Step 5: Push Your changes to this repository
```console
$ git push -u origin main
```
#+end_src
** Generating the ASCII headings
*** Main Heading
#+name: main-heading-text
#+begin_src python :results output
# Enter the Text you want to be converted
text = "Cosmic - Pirates"
# Choose the font
font = "ANSI Shadow"
from jimner import jimner
j = jimner()
result = j.get_banner_from_text(font,text)
print(result)
#+end_src
#+RESULTS: main-heading-text
: ██████╗ ██████╗ ███████╗ ███╗ ███╗ ██╗ ██████╗ ██████╗ ██╗ ██████╗ █████╗ ████████╗ ███████╗ ███████╗
: ██╔════╝ ██╔═══██╗ ██╔════╝ ████╗ ████║ ██║ ██╔════╝ ██╔══██╗ ██║ ██╔══██╗ ██╔══██╗ ╚══██╔══╝ ██╔════╝ ██╔════╝
: ██║ ██║ ██║ ███████╗ ██╔████╔██║ ██║ ██║ █████╗ ██████╔╝ ██║ ██████╔╝ ███████║ ██║ █████╗ ███████╗
: ██║ ██║ ██║ ╚════██║ ██║╚██╔╝██║ ██║ ██║ ╚════╝ ██╔═══╝ ██║ ██╔══██╗ ██╔══██║ ██║ ██╔══╝ ╚════██║
: ╚██████╗ ╚██████╔╝ ███████║ ██║ ╚═╝ ██║ ██║ ╚██████╗ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ███████╗ ███████║
: ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝
:
:
: None
*** About Heading
#+name: about-heading-text
#+begin_src python :results output
# Enter the Text you want to be converted
text = "About"
# Choose the font
font = "Doom"
from jimner import jimner
j = jimner()
print(j.get_banner_from_text(font,text))
#+end_src
#+RESULTS: about-heading-text
#+begin_example
___ _ _
/ _ \ | | | |
/ /_\ \ | |__ ___ _ _ | |_
| _ | | '_ \ / _ \ | | | | | __|
| | | | | |_) | | (_) | | |_| | | |_
\_| |_/ |_.__/ \___/ \__,_| \__|
None
#+end_example
*** News Heading
#+name: news-heading-text
#+begin_src python :results output
# Enter the Text you want to be converted
text = "News"
# Choose the font
font = "Ivrit"
from jimner import jimner
j = jimner()
print(j.get_banner_from_text(font,text))
#+end_src
#+RESULTS: news-heading-text
: _ _
: | \ | | ___ __ __ ___
: | \| | / _ \ \ \ /\ / / / __|
: | |\ | | __/ \ V V / \__ \
: |_| \_| \___| \_/\_/ |___/
:
:
: None
*** FAQ Heading
#+name: FAQ-heading-text
#+begin_src python :results output
# Enter the Text you want to be converted
text = "FAQ"
# Choose the font
font = "Electronic"
from jimner import jimner
j = jimner()
print(j.get_banner_from_text(font,text))
#+end_src
#+RESULTS: FAQ-heading-text
#+begin_example
▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▐░█▀▀▀▀▀▀▀█░▌
▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌
▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌ ▐░▌ ▐░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▐░█▄▄▄▄▄▄▄█░▌
▐░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌
▐░▌ ▐░▌ ▐░▌ ▀▀▀▀▀▀█░█▀▀
▐░▌ ▐░▌ ▐░▌ ▐░▌
▀ ▀ ▀ ▀
None
#+end_example
*** Links Heading
#+name: Links-heading-text
#+begin_src python :results output
# Enter the Text you want to be converted
text = "Links"
# Choose the font
font = "Fender"
from jimner import jimner
j = jimner()
print(j.get_banner_from_text(font,text))
#+end_src
#+RESULTS: Links-heading-text
: '|| '||
: || '' ||
: || || `||''|, || //` (''''
: || || || || ||<< `'')
: .||...| .||. .|| ||. .|| \\. `...'
:
:
:
: None
*** Contact Heading
#+begin_src python :results output
# Enter the Text you want to be converted
text = "Contact"
# Choose the font
font = "Calvin S"
from jimner import jimner
j = jimner()
print(j.get_banner_from_text(font,text))
#+end_src
#+RESULTS:
: ╔═╗ ┌─┐ ┌┐┌ ┌┬┐ ┌─┐ ┌─┐ ┌┬┐
: ║ │ │ │││ │ ├─┤ │ │
: ╚═╝ └─┘ ┘└┘ ┴ ┴ ┴ └─┘ ┴
:
: None
*** Blog List Heading
#+name: Blogs-heading-text
#+begin_src python :results output
# Enter the Text you want to be converted
text = "Blogs"
# Choose the font
font = "Roman"
from jimner import jimner
j = jimner()
print(j.get_banner_from_text(font,text))
#+end_src
#+RESULTS: Blogs-heading-text
#+begin_example
oooooooooo. oooo
`888' `Y8b `888
888 888 888 .ooooo. .oooooooo .oooo.o
888oooo888' 888 d88' `88b 888' `88b d88( "8
888 `88b 888 888 888 888 888 `"Y88b.
888 .88P 888 888 888 `88bod8P' o. )88b
o888bood8P' o888o `Y8bod8P' `8oooooo. 8""888P'
d" YD
"Y88888P'
None
#+end_example
** File Read Write functions
*** Write in the place with a given #+name tag
#+begin_src python :results silent
def write_output_to_org_file(file_path, name, output):
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
#+end_src
*** Read txt files
#+begin_src python
def read_file(file_path):
try:
with open(file_path, 'r') as file:
file_contents = file.read()
return file_contents
except FileNotFoundError:
return "Not found"
#+end_src
#+RESULTS:
: None
* Administrative-scripts
** Blogs
*** Main Blog list
:PROPERTIES:
:HEADER-ARGS: python :tangle scripts/blog-table-generator.py :comments both
:END:
**** Generate Main blog list for [[file:content/blogs/blog-index.org]]
The following code block looks at all org files(except [[file:content/blogs/blog-index.org]] ) in the [[file:content/blogs/]] directory and finds there title, creation date, and last modified date and then creates an org table, then this table is stored as a string in the blog_table variable
# begin_src python :results output raw :exports results
#+name: blog-table-generator
#+begin_src python
import os
from datetime import datetime
# path of the blog directory
blogs_directory = "./content/blogs"
# get a list of all things in blogs_directory
blog_list = os.listdir(blogs_directory)
max_lines_to_scan = 10
#Only include files which are .org and do no include the main Blog-list.org file which serves as an index
b = []
for i in range(0,len(blog_list)):
if blog_list[i].endswith(".org") and blog_list[i] != 'blog-index.org':
b.append(blog_list[i])
blog_list=b
#Sort blog files by last modified time
# blog_list.sort(key=lambda x: os.path.getmtime(blogs_directory+x),reverse=True)
# variable to store output table
blog_table = ""
#prints the heading of the list.
blog_table += ("|-\n")
blog_table += ("|Title|Last Modified|Created|\n")
titles = []
title_found = False
creation_dates = []
creation_found = False
last_modified_found = False
last_modified_dates = []
# finds the title, last modified time and creation time
for blog_no in range(0,len(blog_list)):
with open(blogs_directory +'/'+ blog_list[blog_no], "r") as file:
creation_found = False
last_modified_found = False
title_found = False
for line_no in range(max_lines_to_scan):
try:
line = str(next(file))
except Exception as e:
break
if (line.lower()).startswith('#+title') and title_found == False:
titles.append((line.split(':',1)[1]).strip())
title_found = True
elif (line.lower()).startswith('#+created') and creation_found == False:
creation_dates.append((line.split(':',1)[1]).strip())
creation_found = True
elif (line.lower()).startswith('#+last_modified') and last_modified_found == False:
last_modified_dates.append((line.split(':',1)[1]).strip())
last_modified_found = True
if title_found == True and last_modified_found == True and creation_found == True:
break
if last_modified_found == False:
last_modified_dates.append('unknown')
if creation_found == False:
creation_dates.append('unknown')
if title_found == False:
titles.append('unknown')
blog_table += ("|-\n")
def sort_multiple_lists(*args):
"""This function sorts multiple lists according to the sorting of the first list and returns the sorted lists as a tuple"""
#Extract the firstlist from the argumnts and find its length
first_list = args[0]
list_length = len(first_list)
# Group all corresponding elements into a list of tuples
tuples_list = list(zip(*args))
# Sort the tuples according to there first elements
sorted_tuples_list = sorted(tuples_list,key = lambda x: first_list.index(x[0]),reverse = False)
# Extract the sorted lists and return them
return(list(zip(*sorted_tuples_list)))
# Sort all lists according to creation_date
sorted_creation_dates,sorted_titles,sorted_last_modified_dates,sorted_blog_list = sort_multiple_lists(creation_dates,titles,last_modified_dates,blog_list)
for blog_no in range(0,len(blog_list)):
blog_table += ("|"+ '[[file:'+ sorted_blog_list[blog_no]+ ']' + '['+sorted_titles[blog_no] + ']]'+ '|' +sorted_last_modified_dates[blog_no] + '|' + sorted_creation_dates[blog_no] + '|\n')
#+end_src
**** Write the blog table into [[file:content/blogs/blog-index.org]]
#+begin_src python
def write_output_to_org_file(file_path, name, output):
erase_until_newline_after_name(file_path)
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
def erase_until_newline_after_name(filename):
with open(filename, 'r') as file:
lines = file.readlines()
with open(filename, 'w') as file:
erase = False
for line in lines:
if "#+name" in line:
erase = True
file.write(line)
if erase:
if line == '\n':
erase = False
file.write(line)
else:
file.write(line)
write_output_to_org_file( "content/blogs/blog-index.org", "blog-table-complete", blog_table)
print("Blog table generated successfully")
#+end_src
** The Links table
:PROPERTIES:
:HEADER-ARGS: python :tangle scripts/heading-link-generator.py :comments both
:END:
#+name: link-list
|------+-------+-------+-----+------+-----+-------|
| [[file:index.org][Home]] | [[file:blogs/blog-index.org][Blogs]] | [[file:about.org][About]] | [[file:FAQ.org][FAQ]] | [[file:news.org][News]] | [[file:contact.org][PGP]] | [[file:links.org][Links]] |
|------+-------+-------+-----+------+-----+-------|
*** Read the above link-list
#+begin_src python
def read_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
content = ""
in_name = False
for line in lines:
if "#+name" in line and name in line:
in_name = True
continue
if in_name:
if line == '\n':
in_name = False
else:
content += line
return(content)
def write_to_file(file_path, content):
with open(file_path, 'w') as file:
file.write(content)
heading_link_list = read_until_newline_after_name('main.org','link-list')
#+end_src
*** Write the link table in all files in the root directory except [[file:main.org]]
#+begin_src python
import os
def write_output_to_org_file(file_path, name, output):
erase_until_newline_after_name(file_path,name)
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
def erase_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
with open(filename, 'w') as file:
erase = False
for line in lines:
if "#+name" in line and name in line:
erase = True
file.write(line)
if erase:
if line == '\n':
erase = False
file.write(line)
else:
file.write(line)
def read_file(file_path):
try:
with open(file_path, 'r') as file:
file_contents = file.read()
return file_contents
except FileNotFoundError:
return "Not found"
directory = './content/'
for filename in os.listdir(directory):
if filename.endswith('.org') and filename != 'main.org':
file_path = os.path.join(directory, filename)
# Process the org file here
write_output_to_org_file(file_path,"link-list", heading_link_list)
print(f' Heading links added to {file_path}')
print('All heading links added')
#+end_src
** Onion and I2P addresses
:PROPERTIES:
:HEADER-ARGS: python :tangle scripts/generate_and_update_address_files.py :comments both
:END:
#+name: i2p-b32-address
http://dbtjoqs5jnsyq6m6r35a47jix2v4zeloz5fpxi6htwihpnv3fcxq.b32.i2p
#+name: tor-onionv3-address
http://acfc2abqv65bdiwimrx74vrlxy6eel66cjlmgqqvdekcrx7ufl3c2cad.onion
*** Write to txt files
#+begin_src python
def read_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
content = ""
in_name = False
for line in lines:
if "#+name" in line and name in line:
in_name = True
continue
if in_name:
if line == '\n':
in_name = False
else:
content += line
return(content)
def write_to_file(file_path, content):
with open(file_path, 'w') as file:
file.write(content)
write_to_file('content/static/i2p-b32-address.txt',read_until_newline_after_name('main.org','i2p-b32-address'))
print('content/static/i2p-b32-address.txt written')
write_to_file('content/static/tor-onionv3-address.txt',read_until_newline_after_name('main.org','tor-onionv3-address'))
print('content/static/tor-onionv3-address.txt written')
#+end_src
*** Read and write addresses to all files
#+begin_src python :results silent
import os
def write_output_to_org_file(file_path, name, output):
erase_until_newline_after_name(file_path,name)
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
def erase_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
with open(filename, 'w') as file:
erase = False
for line in lines:
if "#+name" in line and name in line:
erase = True
file.write(line)
if erase:
if line == '\n':
erase = False
file.write(line)
else:
file.write(line)
def read_file(file_path):
try:
with open(file_path, 'r') as file:
file_contents = file.read()
return file_contents
except FileNotFoundError:
return "Not found"
directory = './content/'
for root,dir,filename in os.walk(directory):
for file in filename:
if file.endswith('.org') and file != 'main.org':
file_path = os.path.join(root, file)
# Process the org file here
write_output_to_org_file( file_path,"i2p-b32-address.txt", read_file('i2p-b32-address.txt'))
write_output_to_org_file( file_path,"tor-onionv3-address.txt", read_file('tor-onionv3-address.txt'))
print(f' Addresses written in {file_path}')
#+end_src
* TODO Things to do
** TODO Improve css
** Put something in [[file:content/index.org]]

View file

@ -1,132 +0,0 @@
# Generate Main blog list for [[file:content/blogs/blog-index.org]]
# The following code block looks at all org files(except [[file:content/blogs/blog-index.org]] ) in the [[file:content/blogs/]] directory and finds there title, creation date, and last modified date and then creates an org table, then this table is stored as a string in the blog_table variable
# # begin_src python :results output raw :exports results
# #+name: blog-table-generator
# [[file:../main.org::blog-table-generator][blog-table-generator]]
import os
from datetime import datetime
# path of the blog directory
blogs_directory = "./content/blogs"
# get a list of all things in blogs_directory
blog_list = os.listdir(blogs_directory)
max_lines_to_scan = 10
#Only include files which are .org and do no include the main Blog-list.org file which serves as an index
b = []
for i in range(0,len(blog_list)):
if blog_list[i].endswith(".org") and blog_list[i] != 'blog-index.org':
b.append(blog_list[i])
blog_list=b
#Sort blog files by last modified time
# blog_list.sort(key=lambda x: os.path.getmtime(blogs_directory+x),reverse=True)
# variable to store output table
blog_table = ""
#prints the heading of the list.
blog_table += ("|-\n")
blog_table += ("|Title|Last Modified|Created|\n")
titles = []
title_found = False
creation_dates = []
creation_found = False
last_modified_found = False
last_modified_dates = []
# finds the title, last modified time and creation time
for blog_no in range(0,len(blog_list)):
with open(blogs_directory +'/'+ blog_list[blog_no], "r") as file:
creation_found = False
last_modified_found = False
title_found = False
for line_no in range(max_lines_to_scan):
try:
line = str(next(file))
except Exception as e:
break
if (line.lower()).startswith('#+title') and title_found == False:
titles.append((line.split(':',1)[1]).strip())
title_found = True
elif (line.lower()).startswith('#+created') and creation_found == False:
creation_dates.append((line.split(':',1)[1]).strip())
creation_found = True
elif (line.lower()).startswith('#+last_modified') and last_modified_found == False:
last_modified_dates.append((line.split(':',1)[1]).strip())
last_modified_found = True
if title_found == True and last_modified_found == True and creation_found == True:
break
if last_modified_found == False:
last_modified_dates.append('unknown')
if creation_found == False:
creation_dates.append('unknown')
if title_found == False:
titles.append('unknown')
blog_table += ("|-\n")
def sort_multiple_lists(*args):
"""This function sorts multiple lists according to the sorting of the first list and returns the sorted lists as a tuple"""
#Extract the firstlist from the argumnts and find its length
first_list = args[0]
list_length = len(first_list)
# Group all corresponding elements into a list of tuples
tuples_list = list(zip(*args))
# Sort the tuples according to there first elements
sorted_tuples_list = sorted(tuples_list,key = lambda x: first_list.index(x[0]),reverse = False)
# Extract the sorted lists and return them
return(list(zip(*sorted_tuples_list)))
# Sort all lists according to creation_date
sorted_creation_dates,sorted_titles,sorted_last_modified_dates,sorted_blog_list = sort_multiple_lists(creation_dates,titles,last_modified_dates,blog_list)
for blog_no in range(0,len(blog_list)):
blog_table += ("|"+ '[[file:'+ sorted_blog_list[blog_no]+ ']' + '['+sorted_titles[blog_no] + ']]'+ '|' +sorted_last_modified_dates[blog_no] + '|' + sorted_creation_dates[blog_no] + '|\n')
# blog-table-generator ends here
# Write the blog table into [[file:content/blogs/blog-index.org]]
# [[file:../main.org::*Write the blog table into \[\[file:content/blogs/blog-index.org\]\]][Write the blog table into [[file:content/blogs/blog-index.org]]:1]]
def write_output_to_org_file(file_path, name, output):
erase_until_newline_after_name(file_path)
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
def erase_until_newline_after_name(filename):
with open(filename, 'r') as file:
lines = file.readlines()
with open(filename, 'w') as file:
erase = False
for line in lines:
if "#+name" in line:
erase = True
file.write(line)
if erase:
if line == '\n':
erase = False
file.write(line)
else:
file.write(line)
write_output_to_org_file( "content/blogs/blog-index.org", "blog-table-complete", blog_table)
print("Blog table generated successfully")
# Write the blog table into [[file:content/blogs/blog-index.org]]:1 ends here

View file

@ -1,84 +0,0 @@
# Write to txt files
# [[file:../main.org::*Write to txt files][Write to txt files:1]]
def read_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
content = ""
in_name = False
for line in lines:
if "#+name" in line and name in line:
in_name = True
continue
if in_name:
if line == '\n':
in_name = False
else:
content += line
return(content)
def write_to_file(file_path, content):
with open(file_path, 'w') as file:
file.write(content)
write_to_file('content/static/i2p-b32-address.txt',read_until_newline_after_name('main.org','i2p-b32-address'))
print('content/static/i2p-b32-address.txt written')
write_to_file('content/static/tor-onionv3-address.txt',read_until_newline_after_name('main.org','tor-onionv3-address'))
print('content/static/tor-onionv3-address.txt written')
# Write to txt files:1 ends here
# Read and write addresses to all files
# [[file:../main.org::*Read and write addresses to all files][Read and write addresses to all files:1]]
import os
def write_output_to_org_file(file_path, name, output):
erase_until_newline_after_name(file_path,name)
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
def erase_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
with open(filename, 'w') as file:
erase = False
for line in lines:
if "#+name" in line and name in line:
erase = True
file.write(line)
if erase:
if line == '\n':
erase = False
file.write(line)
else:
file.write(line)
def read_file(file_path):
try:
with open(file_path, 'r') as file:
file_contents = file.read()
return file_contents
except FileNotFoundError:
return "Not found"
directory = './content/'
for root,dir,filename in os.walk(directory):
for file in filename:
if file.endswith('.org') and file != 'main.org':
file_path = os.path.join(root, file)
# Process the org file here
write_output_to_org_file( file_path,"i2p-b32-address.txt", read_file('i2p-b32-address.txt'))
write_output_to_org_file( file_path,"tor-onionv3-address.txt", read_file('tor-onionv3-address.txt'))
print(f' Addresses written in {file_path}')
# Read and write addresses to all files:1 ends here

View file

@ -1,82 +0,0 @@
# Read the above link-list
# [[file:../main.org::*Read the above link-list][Read the above link-list:1]]
def read_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
content = ""
in_name = False
for line in lines:
if "#+name" in line and name in line:
in_name = True
continue
if in_name:
if line == '\n':
in_name = False
else:
content += line
return(content)
def write_to_file(file_path, content):
with open(file_path, 'w') as file:
file.write(content)
heading_link_list = read_until_newline_after_name('main.org','link-list')
# Read the above link-list:1 ends here
# Write the link table in all files in the root directory except [[file:main.org]]
# [[file:../main.org::*Write the link table in all files in the root directory except \[\[file:main.org\]\]][Write the link table in all files in the root directory except [[file:main.org]]:1]]
import os
def write_output_to_org_file(file_path, name, output):
erase_until_newline_after_name(file_path,name)
with open(file_path, 'r') as file:
data = file.readlines()
with open(file_path, 'w') as file:
for line in data:
if '#+name: ' in line and name in line:
file.write(line)
file.write(output)
else:
file.write(line)
def erase_until_newline_after_name(filename,name):
with open(filename, 'r') as file:
lines = file.readlines()
with open(filename, 'w') as file:
erase = False
for line in lines:
if "#+name" in line and name in line:
erase = True
file.write(line)
if erase:
if line == '\n':
erase = False
file.write(line)
else:
file.write(line)
def read_file(file_path):
try:
with open(file_path, 'r') as file:
file_contents = file.read()
return file_contents
except FileNotFoundError:
return "Not found"
directory = './content/'
for filename in os.listdir(directory):
if filename.endswith('.org') and filename != 'main.org':
file_path = os.path.join(directory, filename)
# Process the org file here
write_output_to_org_file(file_path,"link-list", heading_link_list)
print(f' Heading links added to {file_path}')
print('All heading links added')
# Write the link table in all files in the root directory except [[file:main.org]]:1 ends here