This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copyright(c) June 2024 Anderson Mancini | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to | |
| permit persons to whom the Software is furnished to do so, subject to | |
| the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| # Read the incorrect JSON file | |
| with open('jobs.json', 'r') as file: | |
| data = file.read() | |
| # Add commas between documents | |
| fixed_data = re.sub(r'}\s*{', '},\n{', data) | |
| # Write the fixed JSON to a new file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit, OnDestroy } from '@angular/core'; | |
| import { PageService } from 'services/page.service'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] | |
| }) | |
| export class AppComponent implements OnInit { | |
| contents: any = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .page-section { | |
| padding: 6rem 0; | |
| } | |
| .page-section h2.section-heading { | |
| font-size: 2.5rem; | |
| margin-top: 0; | |
| margin-bottom: 1rem; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <section class="page-section bg-light" id="portfolio"> | |
| <div *ngIf="page" class="container"> | |
| <div class="text-center"> | |
| <h2 class="section-heading text-uppercase">{{page.Name}}</h2> | |
| <h3 class="section-subheading text-muted">How to build a simple blog in 10min with Strapi</h3> | |
| </div> | |
| <h4>{{page.content.Title}}</h4> | |
| <div>{{page.content.Value}}</div> | |
| <br/> | |
| <app-post></app-post> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { PostService } from 'services/post.service'; | |
| @Component({ | |
| selector: 'app-post', | |
| templateUrl: './post.component.html', | |
| styleUrls: ['./post.component.scss'] | |
| }) | |
| export class PostComponent implements OnInit { | |
| posts: any = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #post .post-item { | |
| max-width: 25rem; | |
| } | |
| #post .post-item .post-caption { | |
| padding: 1.5rem; | |
| text-align: center; | |
| background-color: #f6f6f6; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div *ngIf="posts" class="row"> | |
| <div *ngFor="let post of posts" class="col-lg-4 col-md-4 col-sm-6"> | |
| <div class="post-item"> | |
| <a class="post-link"> | |
| <img class="img-fluid" src="http://localhost:1337{{post.content.CoverImage[0].url}}" alt="" /></a> | |
| <div class="post-caption"> | |
| <div class="post-caption-heading">{{post.content.Title}}</div> | |
| <div class="post-caption-subheading text-muted">{{post.content.Value}}</div> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { HttpClient } from '@angular/common/http'; | |
| import { environment } from '../src/environments/environment'; | |
| import { map } from 'rxjs/operators'; | |
| @Injectable({ | |
| providedIn: 'root' | |
| }) | |
| export class ContentService { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { HttpClient } from '@angular/common/http'; | |
| import { environment } from '../src/environments/environment'; | |
| import { map } from 'rxjs/operators'; | |
| @Injectable({ | |
| providedIn: 'root' | |
| }) | |
| export class PostService { |
NewerOlder