Skip to content

Commit b0bd025

Browse files
author
aryan
committed
Added GeoGebra and Desmos Graphs functionality - check
1 parent b7baed8 commit b0bd025

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

content/blog/math/add-geogebra-graphs-in-HUGO-as-shortcode.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,26 @@ To integrate GeoGebra into a Hugo website as a shortcode, you can create a custo
8585

8686
---
8787

88-
## Graph
88+
## GeoGebra-JS Graph
8989

9090
{{< geogebra-js id="fe9vckwu" width="800" height="600" >}}
9191

92+
{{< geogebra-js id="qhqxxhp9" width="800" height="600" >}}
93+
94+
95+
96+
## Math/GeoGebra
97+
98+
{{< math/geogebra id="azbxfs9y" width="600" height="600" >}}
99+
100+
{{< math/geogebra id="fe9vckwu" width="600" height="600" >}}
101+
102+
{{< math/geogebra id="u7mzkqt2" width="600" height="600" >}}
103+
104+
## i-frame
105+
106+
<iframe src="https://www.geogebra.org/classic/azbxfs9y?embed" width="800" height="600" allowfullscreen style="border: 1px solid #e4e4e4;border-radius: 4px;" frameborder="0"></iframe>
107+
92108

93109
## 2. How Hugo Shortcodes Work
94110

content/blog/math/create-interactive-math-example-with-geogebra.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ Add a slider for angle size, and watch a triangle's shape change as the angle is
108108
- Use color coding for different elements (e.g., red for important points, blue for lines).
109109
- Align text and objects neatly for a professional look.
110110

111+
{{< geogebra-js id="fe9vckwu" width="650" height="500" >}}
112+
113+
{{< geogebra-js id="qhqxxhp9" width="650" height="500" >}}
114+
111115
---
112116

113117
## **GeoGebra Math Practice (for Algebra and Step-by-Step Problems)**

layouts/shortcodes/geogebra-js.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
{{ $id := delimit (slice "ggb_%d" (partial "functions/uid.html" .)) "-" }}
12
{{ $materialID := .Get "id" | default "" }}
23
{{ $width := .Get "width" | default "800" }}
34
{{ $height := .Get "height" | default "600" }}
4-
<div id="ggb-element-{{ $materialID }}"></div>
5+
<div id="{{ $id }}"></div>
56
<script src="https://www.geogebra.org/apps/deployggb.js"></script>
67
<script>
78
var params = {
@@ -15,6 +16,6 @@
1516
};
1617
var applet = new GGBApplet(params, true);
1718
window.addEventListener("load", function() {
18-
applet.inject('ggb-element-{{ $materialID }}');
19+
applet.inject('{{ $id }}');
1920
});
2021
</script>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ $id := delimit (slice "ggb_%d" (partial "functions/uid.html" .)) "-" }}
2+
3+
{{ $materialID := .Get "id" | default "" }}
4+
{{ $width := .Get "width" | default "800" }}
5+
{{ $height := .Get "height" | default "600" }}
6+
<iframe
7+
src="https://www.geogebra.org/material/iframe/id/{{ $materialID }}/width/{{ $width }}/height/{{ $height }}/border/888888/sfsb/true/smb/false/stb/false/stbh/false/ai/false/sdz/false/sfbl/false"
8+
width="{{ $width }}"
9+
height="{{ $height }}"
10+
style="border:0;"
11+
allowfullscreen>
12+
</iframe>
13+
14+
15+
16+
<style>
17+
18+
19+
</style>

0 commit comments

Comments
 (0)