Retrieve repository information with svn info
svn info to view detailed information about the SVN repository, including the working copy root path, URL, revision number, and the last changed author and date.svn infowebsite·Indexed 29 days ago
https://spike-leung.github.io/blog/A collection of technical articles and guides focusing on front-end development, including static file deployment, SVG map creation, country flag implementation, SVN cheatsheets, and deploying blogs via GitHub Actions.
svn info to view detailed information about the SVN repository, including the working copy root path, URL, revision number, and the last changed author and date.svn infoscp (secure copy) command to transfer the compressed tarball from your local machine to a remote server.scp path/to/tar root@1.1.1.1:/homeFormat: scp [source] [user]@[host]:[destination_path]
.github/workflows directory of your repository. The workflow is event-driven (e.g., triggered by a push event) and consists of jobs that run in a specified environment (e.g., ubuntu-latest). Each job contains a series of steps that can either use pre-defined actions via the uses keyword or execute custom shell commands via the run keyword.# .github/workflows/deploy.yaml
name: deploy-to-github-page
# Trigger the workflow on every push
on: [push]
jobs:
deploy:
# Run the job on a latest Ubuntu runner
runs-on: ubuntu-latest
steps:
# 1. Checkout the repository code
- uses: actions/checkout@v2
# 2. Set up Node.js environment
- uses: actions/setup-node@v2
with:
node-version: '14'
# 3. Install dependencies and build the static site
- run: yarn install
- run: yarn build
# 4. Deploy the build output to the gh-pages branch
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vuepress/distSimplify feature in mapshaper to reduce the number of vertices and export a file of a more manageable size.cd path/to/dist
tar -zcvf build_1.0.tar.gz *Parameter Explanation:
-c: Create a new archive-v: Verbose output (show progress)-z: Compress using Gzip-f: Specify the filename of the archive*: Pack all files in the current directoryTo consistently display country flags across different operating systems, the most reliable method is using PNG images named after the ISO 3166-1 alpha-2 country codes. This avoids compatibility issues where certain operating systems (such as Windows) do not render flag emojis correctly.
Implementation Workflow:
CN.png for China, DE.png for Germany).svn diff output is monochromatic. To add color coding for additions and deletions, install colordiff (via Homebrew on Mac) and pipe the SVN output into it.# Install colordiff
brew install colordiff
# Use colordiff to beautify the output
svn diff menu.jsp -r 23304:23314 | colordiffssh or scp command, generate a local SSH key pair and copy the public key to the remote server.# 1. Generate the key pair
ssh-keygen
# 2. Upload the public key to the server
ssh-copy-id -i path/to/.ssh/id_rsa.pub root@1.1.1.1Note: Ensure you use the public key file (ending in .pub) when using ssh-copy-id.
root path).# Navigate to the target directory
cd path/to/static_file_folder
# Extract the archive
tar -xvf build.1.0.tar.gzParameter Explanation:
-x: Extract the contents of the archive--targets flag to commit only those files.# 1. Export changed files to target.txt
svn st -q | cut -c 9- > ~/target.txt
# 2. (Optional) Manually edit ~/target.txt to remove unwanted files
# 3. Commit using the target list
svn commit --targets ~/target.txtTo use a custom SVG map in amMap, the SVG must be converted to a JSON format.
<g> tags..shp, .shx, .prj, .dbf) using mapshaper and then converting the resulting SVG to amMap-compatible JSON.# Example mapshaper console commands to isolate a specific region (e.g., Zibo, Shandong)
# 1. Filter for the specific region
filter 'NAME_1 == "Shandong" && NAME_2 == "Zibo" && NAME_3 != "Gaoqing" || NAME_3 == "Zouping"'
# 2. Clean up the map
-clean
# 3. Remove internal lines to keep only the outer boundary
-dissolve
-clean