Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
santhalakshminarayana committed Apr 16, 2024
1 parent 1c5b06e commit aa0abcb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 127 deletions.
47 changes: 0 additions & 47 deletions lib/get-all-posts-data.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//import dynamic from 'next/dynamic';
//import {metadata, _importMeta as postPaths} from '../posts/*'

const fs = require("fs");
const path = require("path");
const matter = require("gray-matter");
Expand Down Expand Up @@ -30,19 +27,6 @@ export function getAllPostsPath() {
},
};
});

/*
return metadata.map((post_metadata, index) => {
let path = postPaths[index]?.importedPath;
let path_list = path.split('/');
path = path_list[path_list.length - 1].replace(/\.mdx$/, '');
return {
params: {
id: path,
}
}
})
*/
}

export function getAllPostsMetadata() {
Expand All @@ -67,34 +51,13 @@ export function getAllPostsMetadata() {
return -1;
}
});

/*
const postsMetadata = metadata.map((metadata, index) => {
let path = postPaths[index]?.importedPath;
let path_list = path.split('/');
path = path_list[path_list.length - 1].replace(/\.mdx$/, '');
//console.log(path);
metadata['id'] = path;
return { metadata }
});
return postsMetadata.sort((a, b) => {
if (new Date(a.metadata.date) < new Date(b.metadata.date)) {
return 1;
}
else {
return -1;
}
})
*/
}

export function getPostMetadata(id) {
const postMetadata = metadata.filter((metadata, index) => {
let path = postPaths[index]?.importedPath;
let path_list = path.split("/");
path = path_list[path_list.length - 1].replace(/\.mdx$/, "");
//console.log(path, id);
if (path == id) return { metadata };
});
return postMetadata;
Expand All @@ -111,14 +74,4 @@ export function getPostData(id) {
metadata["id"] = id;

return { metadata: metadata, content: content };

/*
const full_path = path.join(postsDirectory, `${id}.mdx`);
const MDXContent = dynamic(() => import(full_path));
const mdx = <MDXContent />
return {
id,
mdx,
}
*/
}
52 changes: 0 additions & 52 deletions lib/get-all-tags.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//import dynamic from 'next/dynamic';
//import {metadata, _importMeta as postPaths} from '../posts/*.mdx';

const fs = require("fs");
const path = require("path");
const matter = require("gray-matter");
Expand Down Expand Up @@ -62,7 +59,6 @@ export function getTagPostsMetadata(tag_name) {
const allPostsMetadata = getallPostsMetadata();

let postsMetadata = allPostsMetadata.filter((metadata, index) => {
//metadata['display_img'] = '../' + metadata['display_img'];
if (metadata.tags.indexOf(tag_name) != -1) return { metadata };
});

Expand All @@ -78,51 +74,3 @@ export function getTagPostsMetadata(tag_name) {
}
});
}

/*
export function getAllTagsPath() {
const allTags = new Set();
metadata.map((post_metadata, index) => {
post_metadata.tags.map((tag_name, index) => {
allTags.add(tag_name);
})
})
console.log(allTags);
return [...allTags].map((tag_name, index) => {
return {
params: {
id: tag_name
}
}
})
}
export function getTagPostsMetadata(tag_name) {
let postsMetadata = metadata.filter((metadata, index) => {
metadata['display_img'] = '../' + metadata['display_img'];
let path = postPaths[index]?.importedPath;
let path_list = path.split('/');
path = path_list[path_list.length - 1].replace(/\.mdx$/, '');
console.log(path)
metadata['id'] = path;
if (metadata.tags.indexOf(tag_name) != -1)
return { metadata };
});
postsMetadata = postsMetadata.map((metadata, index) => {
return { metadata};
})
return postsMetadata.sort((a, b) => {
if (new Date(a.date) < new Date(b.date)) {
return 1;
}
else {
return -1;
}
})
}
*/
8 changes: 0 additions & 8 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ import Head from "next/head";

import "../styles/global_styles.css";

/*
export function reportWebVitals(metric) {
console.log(metric)
}
<meta name="google-site-verification" content="3p5W6wHr-TDhnkyuewv0nYJd2S9OuTQlj5__OUyLLcU" />
*/

export default function App({ Component, pageProps }) {
return (
<>
Expand Down
2 changes: 0 additions & 2 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Head from "next/head";
import Link from "next/link";

import Header from "../components/Header.js";
import Tags from "../components/Tags.js";
import Footer from "../components/Footer.js";
import CardLayout from "../components/CardLayout.js";

Expand Down
36 changes: 18 additions & 18 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://santhalakshminarayana.github.io</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/about</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/advanced-golang-memory-model-concurrency</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/build-blog-with-nextjs-mdx-and-deploy-to-github-pages</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/chromatic-adaptation</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/color-science</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/color-theory</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/concurrency-patterns-python</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/create-a-notes-app-with-flutter</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/go-gotchas-and-good-practices</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/retinex-image-enhancement</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/retinex-theory-of-color-vision</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-cython</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-good-practices</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-multi-processing</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-numba</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-why-python-slow</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/whiteboard-image-enhancement-opencv-python</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-13T07:27:17.819Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/about</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/advanced-golang-memory-model-concurrency</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/build-blog-with-nextjs-mdx-and-deploy-to-github-pages</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/chromatic-adaptation</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/color-science</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/color-theory</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/concurrency-patterns-python</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/create-a-notes-app-with-flutter</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/go-gotchas-and-good-practices</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/retinex-image-enhancement</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/retinex-theory-of-color-vision</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-cython</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-good-practices</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-multi-processing</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-numba</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/super-fast-python-why-python-slow</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
<url><loc>https://santhalakshminarayana.github.io/blog/whiteboard-image-enhancement-opencv-python</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2024-04-16T17:51:15.779Z</lastmod></url>
</urlset>

0 comments on commit aa0abcb

Please sign in to comment.