Skip to content

Commit

Permalink
added webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
SlashGordon committed Nov 21, 2023
1 parent 253b4e5 commit 9f6e5d8
Show file tree
Hide file tree
Showing 165 changed files with 15,370 additions and 23 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,8 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
output/
node_modules/
package-lock.json
themes/stocks/static/stylesheet/styles.css
themes/stocks/static/js/bundle.js
.DS_Store
1 change: 1 addition & 0 deletions content/about.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Title: About Us
Date: 2023-11-20
Author: Slash

# About Our Website

Expand Down
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "techstocksinsight.github.io",
"version": "1.0.0",
"description": "Welcome to the cool side of finance — where charts tell stories and success is just a click away!",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack serve --mode development --open",
"build": "webpack --mode production && mkdir -p themes/stocks/static/js && cp dist/bundle.js themes/stocks/static/js/bundle.js && cp dist/styles.css themes/stocks/static/stylesheet/styles.css"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"babel-loader": "^9.1.3",
"css-loader": "^6.8.1",
"html-webpack-plugin": "^5.5.3",
"mini-css-extract-plugin": "^2.7.6",
"node-sass": "^9.0.0",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"bootstrap": "^5.3.2",
"highcharts": "^11.2.0",
"jquery": "^3.7.1"
}
}
27 changes: 12 additions & 15 deletions pelicanconf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AUTHOR = 'SlashGordon'
SITENAME = 'portfolioplus'
SITEURL = ""

SITEURL = ''
MAIN_MENU = True
PATH = "content"

TIMEZONE = 'Europe/Berlin'
Expand All @@ -15,23 +15,20 @@
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None

# Blogroll
LINKS = (
("Pelican", "https://getpelican.com/"),
("Python.org", "https://www.python.org/"),
("Jinja2", "https://palletsprojects.com/p/jinja/"),
("You can modify those links in your config file", "#"),
MENUITEMS = (
("Archives", "/archives.html"),
("Categories", "/categories.html"),
("Tags", "/tags.html"),
)

# Social widget
SOCIAL = (
("You can add links in your config file", "#"),
("Another social link", "#"),
)

from mysiteplugins import stocks
import os

PLUGINS = [stocks]
PLUGINS = [stocks, "pelican.plugins.webassets"]
DEFAULT_PAGINATION = 10

STATIC_PATHS = ["dist"]
THEME ="themes/stocks"
# Uncomment following line if you want document-relative URLs when developing
# RELATIVE_URLS = True
RELATIVE_URLS = os.environ.get("DEBUG", "0") == "1"
139 changes: 138 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ python = "^3.11"
pelican = {extras = ["markdown"], version = "^4.9.1"}
pytickersymbols = "^1.15.0"
pyyaml = "^6.0.1"
pelican-search = "^1.1.0"
pelican-neighbors = "^1.2.0"
pelican-readtime = "^0.2.0"
pelican-webassets = "^2.0.0"


[build-system]
Expand Down
27 changes: 27 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- src/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My NPM Project</title>
</head>
<body>
<h1>Hello, NPM Project!</h1>

<div id="chartContainer" style="height: 300px;"></div>

<script>
document.addEventListener('DOMContentLoaded', function() {
highcharts.chart('chartContainer', {
title: {
text: 'My Chart'
},
series: [{
data: [1, 3, 2, 4]
}]
});
});
</script>
</body>
</html>
30 changes: 30 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// src/index.js
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
import highcharts from 'highcharts';

import Highcharts from 'highcharts';

console.log('Hello from index.js!');

// Dynamic chart logic
function createDynamicChart() {
// Get chart container and attributes
const chartContainer = document.getElementById('chartContainer');
const title = chartContainer.getAttribute('data-chart-title') || 'Dynamic Chart';
const dataAttribute = chartContainer.getAttribute('data-chart-data');
const chartData = dataAttribute ? JSON.parse(dataAttribute) : [5, 2, 8, 1];

// Create Highcharts chart
Highcharts.chart(chartContainer, {
title: {
text: title
},
series: [{
data: chartData
}]
});
}

// Trigger the dynamic chart creation
createDynamicChart();
Loading

0 comments on commit 9f6e5d8

Please sign in to comment.